You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
moduleAmbiguous2tuple[str] f(tuple[str] tup) = <tup<0>> when _ := tup;
Both modules give rise to an ambiguity error in the REPL, as reported in usethesource/rascal#2122 and usethesource/rascal#2125. However, in the UI, VS Code reports no errors for module Ambiguous1, while it reports the following error for Ambiguous2 (each time the module is changed, regardless of the change, as long as the definition of f is kept):
Exception thrown
Undeclared field: signature for Tree
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/UndeclaredField|
Stacktrace:
org.rascalmpl.interpreter.staticErrors.UndeclaredField: Undeclared field: signature for Tree
Advice: |https://www.rascal-mpl.org/docs/Rascal/Errors/CompileTimeErrors/UndeclaredField|
at DocumentSymbols.?(/lang/rascal/lsp/DocumentSymbols.rsc:65)
at org.rascalmpl.interpreter.result.ConstructorResult.fieldAccess(ConstructorResult.java:120)
at org.rascalmpl.interpreter.result.ConcreteSyntaxResult.fieldAccess(ConcreteSyntaxResult.java:84)
at org.rascalmpl.semantics.dynamic.Expression$FieldAccess.interpret(Expression.java:869)
at org.rascalmpl.semantics.dynamic.Expression$FieldAccess.interpret(Expression.java:866)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
at org.rascalmpl.interpreter.StringTemplateConverter$Visitor$IndentingAppend.interpret(StringTemplateConverter.java:108)
at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
at org.rascalmpl.semantics.dynamic.Statement$For.interpret(Statement.java:468)
at org.rascalmpl.semantics.dynamic.Literal$String.interpret(Literal.java:237)
at org.rascalmpl.semantics.dynamic.Expression$Literal.interpret(Expression.java:1596)
at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:502)
at org.rascalmpl.semantics.dynamic.Expression$List.interpret(Expression.java:1521)
at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
at org.rascalmpl.semantics.dynamic.Statement$Assignment.interpret(Statement.java:205)
at org.rascalmpl.interpreter.utils.Cases.matchAndEval(Cases.java:443)
at org.rascalmpl.interpreter.utils.Cases$DefaultBlock.matchAndEval(Cases.java:271)
at org.rascalmpl.interpreter.TraversalEvaluator.applyCases(TraversalEvaluator.java:645)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseTop(TraversalEvaluator.java:669)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:140)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseListOnce(TraversalEvaluator.java:510)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:167)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseADTOnce(TraversalEvaluator.java:353)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:163)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseListOnce(TraversalEvaluator.java:510)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:167)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseADTOnce(TraversalEvaluator.java:353)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:163)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseListOnce(TraversalEvaluator.java:510)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:167)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseADTOnce(TraversalEvaluator.java:353)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:163)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseListOnce(TraversalEvaluator.java:510)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:167)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseADTOnce(TraversalEvaluator.java:353)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:163)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseListOnce(TraversalEvaluator.java:510)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:167)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseADTOnce(TraversalEvaluator.java:353)
at org.rascalmpl.interpreter.TraversalEvaluator.traverseOnce(TraversalEvaluator.java:163)
at org.rascalmpl.interpreter.TraversalEvaluator.traverse(TraversalEvaluator.java:122)
at org.rascalmpl.semantics.dynamic.Visit$GivenStrategy.interpret(Visit.java:132)
at org.rascalmpl.semantics.dynamic.Statement$Visit.interpret(Statement.java:1022)
at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:384)
at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:325)
at org.rascalmpl.interpreter.result.AbstractFunction.call(AbstractFunction.java:198)
at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:769)
at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:752)
at org.rascalmpl.interpreter.Evaluator.call(Evaluator.java:558)
at org.rascalmpl.vscode.lsp.rascal.RascalLanguageServices.lambda$getDocumentSymbols$10(RascalLanguageServices.java:203)
at org.rascalmpl.vscode.lsp.util.EvaluatorUtil.lambda$runEvaluator$0(EvaluatorUtil.java:96)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
The text was updated successfully, but these errors were encountered:
The second example makes the top-level function decapitation ambiguous. So the amb node is where the pattern for function declaration matches. Next thing the signature field is projected which doesn't exist on the amb node.
The first example has the ambiguity nested deeper, where it can do less harm.
Best solution would be the start the visit with a generic amb node case: case amb(set[Tree] alts) and either ignore it altogether, or pick one alternative to continue, or put an ambiguous DocumentSymbol in the hierarchie.
Context
Consider the following two modules:
Both modules give rise to an ambiguity error in the REPL, as reported in usethesource/rascal#2122 and usethesource/rascal#2125. However, in the UI, VS Code reports no errors for module
Ambiguous1
, while it reports the following error forAmbiguous2
(each time the module is changed, regardless of the change, as long as the definition off
is kept):Exception thrown
Stacktrace:
The text was updated successfully, but these errors were encountered: