langium icon indicating copy to clipboard operation
langium copied to clipboard

Pass target type into reference

Open msujew opened this issue 3 years ago • 1 comments

In a few cases we had issues resolving to the expected type of a reference. This is due to AstReflection.getReferenceType not always working correctly in cases such as fragments.

This change stores the target type on the reference when it is created, removing the need for getReferenceType altogether.

msujew avatar Sep 19 '22 08:09 msujew

This change has a cost: it adds an additional property to every instance of a reference, which can mean a lot for large ASTs.

Could you identify a specific grammar example where reference resolution fails with the previous approach?

spoenemann avatar Sep 30 '22 11:09 spoenemann

Can this be closed in favor of #822?

spoenemann avatar Dec 14 '22 10:12 spoenemann