Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TC crashes on node pattern with keyword parameters #458

Closed
PaulKlint opened this issue Dec 23, 2013 · 5 comments
Closed

TC crashes on node pattern with keyword parameters #458

PaulKlint opened this issue Dec 23, 2013 · 5 comments

Comments

@PaulKlint
Copy link
Member

This

value main(list[value] args)  ="f1"(1, M=10)          := "f1"(1, M=10);

gives

|rascal://lang::rascal::types::CheckTypes|(179075,25,<3507,16>,<3507,41>): The called signature: extractPatternTree(sort("Pattern"), Configuration),
does not match the declared signature:  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern); BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  BindResult extractPatternTree(sort("Pattern"), Configuration); (concrete pattern);  
@mahills
Copy link
Member

mahills commented Jan 8, 2014

Similarly to #478 this isn't really doing anything (and, for nodes, maybe can't), but it at least is doing the match properly so it doesn't crash.

@PaulKlint
Copy link
Member Author

This one is also mostly done and again great work @mahills! I found two remaining issues where a variable (in this test X) is introduced at the position of the default value of a keyword parameter and is not properly introduced by the TC. This applies both to ADT patterns and node patterns:

module experiments::Compiler::Examples::Tst

data F1 = f1(int N, int M = 10, bool B = false) | f1(str S);

public test bool matchADTwithKeywords5() =   f1(1, M=X)   := f1(1, B=false, M=20)   && X == 20;

public test bool matchNodeWithKeywords16() = "f1"(1, M=X) := "f1"(1, B=false, M=20) && X == 20;

gives

error("Name X is not in scope",|rascal:///experiments/Compiler/Examples/Tst.rsc|(291,1,<7,87>,<7,88>))
error("Name X is not in scope",|rascal:///experiments/Compiler/Examples/Tst.rsc|(194,1,<5,87>,<5,88>))

@PaulKlint PaulKlint reopened this Jan 9, 2014
@PaulKlint
Copy link
Member Author

The above example cannot yet be handled.

@mahills
Copy link
Member

mahills commented Aug 7, 2014

I commented on #277 but that now relates to this -- the remaining case appears to be a pattern where the constructed term is of type node instead of using the constructor name directly.

@mahills
Copy link
Member

mahills commented Aug 7, 2014

This is now working correctly.

@mahills mahills closed this as completed Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants