eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
663 stars 61 forks source link

BugFix: Correct isAstTypeInternal checking logic #1563

Closed montymxb closed 4 hours ago

montymxb commented 1 week ago

This corrects a recently found bug where the internal isAstTypeInternal logic would return false for property types that should otherwise return true. The issue has to do with the fact we always return false when encountering a previously visited prop type, instead of returning it's previously computed result when we visited. To correct, we just make a change from Set -> Map and adjust the logic accordingly to save results as we go.

I would really like to add a test case to this, but the affected grammar is unable to be shared, and I haven't been able to reliably factor out a small test grammar; at least so far. I'll keep this in draft until we make a decision in this regard.

montymxb commented 1 week ago

Nice! Thanks @msujew , that should work.