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 Exception;
import ParseTree;
syntax A = a: "a";
test bool tstA(){
pt = parse(#A, "a");
return a() := pt && pt is a;
}
gives
error("Could not instantiate type variables in type fun &T \<: Tree(type[&T \<: Tree], loc) with argument types (type[A],str)",|rascal:///experiments/Compiler/Examples/Tst.rsc|(327,14,<17,9>,<17,23>))
error("Function of type fun &T \<: Tree(type[&T \<: Tree], map[Production robust, list[CharRange] lookaheads], str, loc) cannot be called with argument types (type[A],str)",|rascal:///experiments/Compiler/Examples/Tst.rsc|(327,14,<17,9>,<17,23>))
error("Could not instantiate type variables in type fun &T \<: Tree(type[&T \<: Tree], str) with argument types (type[A],str)",|rascal:///experiments/Compiler/Examples/Tst.rsc|(327,14,<17,9>,<17,23>))
error("Name pt is not in scope",|rascal:///experiments/Compiler/Examples/Tst.rsc|(367,2,<18,24>,<18,26>))
error("Name pt is not in scope",|rascal:///experiments/Compiler/Examples/Tst.rsc|(361,2,<18,18>,<18,20>))
error("Function of type fun &T \<: Tree(type[&T \<: Tree], str, loc) cannot be called with argument types (type[A],str)",|rascal:///experiments/Compiler/Examples/Tst.rsc|(327,14,<17,9>,<17,23>))
|rascal://experiments::Compiler::Rascal2muRascal::RascalModule|(2652,25,<80,12>,<80,37>): "Module contains errors!"
The text was updated successfully, but these errors were encountered:
This is most likely because Tree has a special status in the type system -- it is a normal ADT that also happens to be the supertype of all concrete syntax types.
I think I just need to call my own subtype function which checks this case first and then dispatches to the normal subtype function. I will work on it today.
This is now working. I added support for making Tree a supertype of all concrete syntax nonterminal types -- this was actually a fairly straightforward addition to ParseTree.rsc. Getting the rest of it working wasn't so straight-forward...
gives
The text was updated successfully, but these errors were encountered: