Open RandomActsOfGrammar opened 3 years ago
Interesting. What happens if you specify the flow types for the translation
attributes explicitly? Curious if this is a bug with flow type inference or lookup.
Also, do you have a minimal example somewhere that reproduces this?
If I specify the flow types, the errors are reduced to a single error for exceeding the flow type.
I'm not having any luck creating a minimal example. My attempts thus far have not given errors.
I have four grammars:
common
,A
,B
, andmain
. BothA
andB
importcommon
, andmain
imports all three.The grammar
common
defines several nonterminals and productions shared betweenA
andB
. BothA
andB
define a synthesized attribute namedtranslation
, both of which occur on these shared nonterminals. InA
, thetranslation
depends on some attributes which only occur inA
. There are no flow errors in eitherA
orB
alone.When I compile the
main
grammar, I get flow errors inB
for accessingB
'stranslation
attribute without giving the inherited attributes necessary forA
'stranslation
attribute. It doesn't matter which grammar is imported first.