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
import ParseTree;
import lang::rascal::\syntax::Rascal;
private Symbol removeConditionals(Symbol sym) = visit(sym) {
case conditional(s, _) => s
};
This generates:
[INFO] Warnings and errors for lang/rascal/grammar/ConcreteSyntax.rsc
[ERROR] lang/rascal/grammar/ConcreteSyntax.rsc:068:007: A pattern of type Replacement cannot be replaced by Expression
data Symbol // <19>
= \conditional(Symbol symbol, set[Condition] conditions);
Both conditional constructors have two arguments, so they might indeed match the pattern. In this case a warning or error regarding the ambiguous constructor is expected:
Ambiguous constructor conditional could be either X or Y
But the type-checker currently forgets accidentally about the Symbol version.
I'm not sure if the visit is essential in this example. I think it does require an ambiguous constructor on the pattern side. I'm fixing the code in the standard library to avoid this issue for now.
The text was updated successfully, but these errors were encountered:
Describe the bug
This generates:
The cause is:
and
Both
conditional
constructors have two arguments, so they might indeed match the pattern. In this case a warning or error regarding the ambiguous constructor is expected:But the type-checker currently forgets accidentally about the
Symbol
version.I'm not sure if the
visit
is essential in this example. I think it does require an ambiguous constructor on the pattern side. I'm fixing the code in the standard library to avoid this issue for now.The text was updated successfully, but these errors were encountered: