Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnalyzeTemplate should not throw an exception on recursive templates #3791

Closed
chrimc62 opened this issue Jun 23, 2021 · 4 comments · Fixed by #3807
Closed

AnalyzeTemplate should not throw an exception on recursive templates #3791

chrimc62 opened this issue Jun 23, 2021 · 4 comments · Fixed by #3807
Assignees
Labels
Area: LG Language generation issues bug Indicates an unexpected problem or an unintended behavior.
Milestone

Comments

@chrimc62
Copy link
Contributor

Versions

Package: 4.13.6
Node: 12.19.1

Describe the bug

When analyzing this template a recursive loop exception is raised.

# sortNumber(number, divisor)
> Return a string with leading zeros out to divisor
- ${if(divisor == 1,
    string(number),
    concat(string(div(number, divisor)), sortNumber(mod(number, divisor), div(divisor, 10))))}

Expected behavior

sortNumber should list itself as one of the templates it uses and there should be no exception.

image

@chrimc62 chrimc62 added bug Indicates an unexpected problem or an unintended behavior. Area: LG Language generation issues needs-triage The issue has just been created and it has not been reviewed by the team. labels Jun 23, 2021
@joshgummersall joshgummersall added this to To do in Adaptive Expressions via automation Jun 23, 2021
@joshgummersall joshgummersall removed this from To do in Adaptive Expressions Jun 23, 2021
@joshgummersall
Copy link
Contributor

@Danieladu, git blame shows you are someone that's pretty familiar with this code. Could you take a look?

@Danieladu
Copy link
Contributor

@Danieladu, git blame shows you are someone that's pretty familiar with this code. Could you take a look?

Sure

@Danieladu
Copy link
Contributor

@chrimc62 You have created the same issue before: #3619, and we fixed it in #3621 two months ago. But the change would appears in 4.14 version.
Could you take a look and make sure it meets your requirements.

@joshgummersall joshgummersall removed the needs-triage The issue has just been created and it has not been reviewed by the team. label Jun 24, 2021
@joshgummersall joshgummersall added this to the R14 milestone Jun 24, 2021
joshgummersall pushed a commit that referenced this issue Jun 24, 2021
@joshgummersall
Copy link
Contributor

I've added a test case via the linked PR, but I'll close this issue as it does not reproduce in main.

joshgummersall pushed a commit that referenced this issue Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: LG Language generation issues bug Indicates an unexpected problem or an unintended behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants