rascal
rascal copied to clipboard
ambiguous code ` l <- m.methodOverrides<to,from>[hashCodeMethod]`
Describe the bug
Ambiguous code (internal error), l <- m.methodOverrides<to,from>[hashCodeMethod]
org.rascalmpl.interpreter.asserts.Ambiguous: Ambiguous code (internal error), l <- m.methodOverrides<to,from>[hashCodeMethod]
at org.rascalmpl.parser.uptr.UPTRNodeFactory.buildAmbiguityNode(UPTRNodeFactory.java:76)
at org.rascalmpl.parser.uptr.UPTRNodeFactory.createListAmbiguityNode(UPTRNodeFactory.java:93)
at org.rascalmpl.parser.uptr.UPTRNodeFactory.createListAmbiguityNode(UPTRNodeFactory.java:23)
at org.rascalmpl.parser.gtd.result.out.ListContainerNodeFlattener.convertToUPTR(ListContainerNodeFlattener.java:529)
at org.rascalmpl.parser.gtd.result.out.DefaultNodeFlattener.convert(DefaultNodeFlattener.java:65)
It seems there is ambiguity at the level of the <-
error when field projecten is at play. Could be more complex. See the above example.
this alternative with brackets is not ambiguous:
[ info("overrides Object.hashCode()", l) | l <- (m.methodOverrides<to,from>)[hashCodeMethod]]
Duplicate of #1381?
Looks like the <-
plays a role here too. So it could be same part of the grammar where priorities are missing or invalid? Not a strict duplicate, but it seems to be related to #1381. Thanks @rodinaarssen
You are right. It seems that the subexpression m<t,f>[index]
is only ambiguous within a certain context. Here, it is inside <-
, in #1381 inside a function call.