Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Conversation

@Danieladu
Copy link
Contributor

Fixes #2340
Original PR:microsoft/botbuilder-dotnet#4779

Description

Having two language generation files that import each other causes an infinite loop.

Specific Changes

Throw exception when occurs the cycle reference in LG import.
For example: there are two Lg files:
a.lg

> Import b.lg
[b](./b.lg)
# a
- a

and b.lg

> Import a.lg
[a](./a.lg)
# b
- b

When parsing the a.lg, using Templates.ParseFile("a.lg"), would get a "loop detect exception."

@Danieladu Danieladu requested a review from a team as a code owner October 19, 2020 08:28
Copy link
Contributor

@joshgummersall joshgummersall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few inline suggestions. Otherwise, this looks good!

Copy link
Contributor

@joshgummersall joshgummersall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me.

@Danieladu Danieladu merged commit 25c3ec9 into main Oct 20, 2020
@Danieladu Danieladu deleted the hond/cycle branch October 20, 2020 05:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[botbuilder-lg] [bug] Infinite Loop in Imports

3 participants