rascal icon indicating copy to clipboard operation
rascal copied to clipboard

`"abc" + i` is Ambiguous ??

Open DavyLandman opened this issue 12 years ago • 1 comments

rascal>"abc" + i;
org.rascalmpl.interpreter.asserts.Ambiguous: Ambiguous code (internal error), "abc" + i;(internal error)    at $shell$(|main://$shell$|)
org.rascalmpl.interpreter.asserts.Ambiguous: Ambiguous code (internal error), "abc" + i;
    at org.rascalmpl.parser.ASTBuilder.buildValue(ASTBuilder.java:149)
    at org.rascalmpl.parser.ASTBuilder.buildSort(ASTBuilder.java:131)
    at org.rascalmpl.parser.ASTBuilder.buildCommand(ASTBuilder.java:114)
    at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:989)
    at org.rascalmpl.interpreter.Evaluator.eval(Evaluator.java:949)
    at org.rascalmpl.shell.RascalShell.handleInput(RascalShell.java:174)
    at org.rascalmpl.shell.RascalShell.run(RascalShell.java:136)
    at org.rascalmpl.shell.RascalShell.main(RascalShell.java:216)

DavyLandman avatar Oct 22 '13 13:10 DavyLandman

  • Apparently the ; is essential in this example to trigger the ambiguity.
  • By that it becomes a possible declaration of an uninitialized variable of type "abd"+
  • Or it is the expression statement that adds i to "abc"

jurgenvinju avatar Aug 17 '23 09:08 jurgenvinju