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 gives incorrect error messages for library file APIGen.rsc #482

Closed
PaulKlint opened this issue Jan 10, 2014 · 11 comments
Closed

TC gives incorrect error messages for library file APIGen.rsc #482

PaulKlint opened this issue Jan 10, 2014 · 11 comments

Comments

@PaulKlint
Copy link
Member

 compile(|project://rascal/src/org/rascalmpl/library/APIGen.rsc|);

gives

error("Type of pattern could not be computed, please add additional type annotations",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(3641,16,<89,62>,<89,78>))
error("Type of pattern could not be computed, please add additional type annotations",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(3281,33,<80,24>,<80,57>))
error("Name cs is not in scope",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(7837,2,<207,39>,<207,41>))
error("Expected type bool, found fail",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(7726,25,<206,46>,<206,71>))
error("Multiple constructors and/or productions match this pattern, add additional type annotations",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(2134,15,<61,11>,<61,26>))
error("Type of pattern could not be computed",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(2134,15,<61,11>,<61,26>))
error("Field definitions does not exist on type type",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(7738,13,<206,58>,<206,71>))
error("Name t2 is not in scope",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(3093,2,<73,87>,<73,89>))
error("Function of type fun str(str) cannot be called with argument types (inferred(11))",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(2159,18,<61,36>,<61,54>))
error("Multiple constructors and/or productions match this pattern, add additional type annotations",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(6028,12,<166,11>,<166,23>))
error("Function of type fun str(Symbol) cannot be called with argument types (inferred(41))",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(3603,21,<89,24>,<89,45>))
error("Function of type fun str(Symbol) cannot be called with argument types (value)",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(3468,22,<85,26>,<85,48>))
error("Field definitions does not exist on type type",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(7769,13,<206,89>,<206,102>))
error("Expected type str, found fail",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(7795,48,<206,115>,<207,45>))
error("Type of pattern could not be computed",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(6028,12,<166,11>,<166,23>))
error("Expected type bool, found fail",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(7753,39,<206,73>,<206,112>))
error("Invalid return type str, expected return type void",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(3323,61,<81,5>,<81,66>))
error("Could not calculate function type because of errors calculating the parameter types",|project://rascal/src/org/rascalmpl/library/APIGen.rsc|(3259,56,<80,2>,<80,58>))
@ghost ghost assigned mahills Jan 10, 2014
@mahills
Copy link
Member

mahills commented Jan 10, 2014

This one is a real error, the name should be qualified:

error(
"Multiple constructors and/or productions match this pattern, add additional type annotations",
|project://RascalLibrary/src/APIGen.rsc|(2134,15,<61,11>,<61,26>))

The other errors on the same line are based on this.

@mahills
Copy link
Member

mahills commented Jan 10, 2014

This error also appears to be a valid error:

error(
"Name t2 is not in scope",
|project://RascalLibrary/src/APIGen.rsc|(3093,2,<73,87>,<73,89>)),

t2 really isn't in scope on this source line.

@mahills
Copy link
Member

mahills commented Jan 10, 2014

Not sure the problem with this, but it looks like it should type:

error(
"Type of pattern could not be computed, please add additional type annotations",
|project://RascalLibrary/src/APIGen.rsc|(3281,33,<80,24>,<80,57>)),

@mahills
Copy link
Member

mahills commented Jan 10, 2014

I need to add support for the fields on type directly into the checker, that is what is causing this problem:

error(
"Field definitions does not exist on type type",
|project://RascalLibrary/src/APIGen.rsc|(7738,13,<206,58>,<206,71>)),

@mahills
Copy link
Member

mahills commented Jan 10, 2014

I think the rest of the errors are knock-on errors from these. I'll look at the last two, but it looks like there are also some genuine errors in there.

@mahills
Copy link
Member

mahills commented Aug 7, 2014

I added support (soon to be checked in) for the definitions field on type. I need to look through the other errors and see which are real errors and which are problems in the checker.

@PaulKlint
Copy link
Member Author

Sounds good, will check when you have checked this in.

@mahills
Copy link
Member

mahills commented Aug 8, 2014

This is checked in, although I still need to look through the other errors to see which are real and which are bugs in the checker.

@PaulKlint
Copy link
Member Author

I think APIGen is little used (to be honest I don't know who uses it) so there may be real errors there.

@mahills
Copy link
Member

mahills commented Aug 15, 2014

I fixed a couple of errors in the checker and also a number of errors in APIGen. It now passes the checker, although it probably still needs some work before it can really be used again (I opened an issue specifically about keyword parameters, since there is no support for them in constructors in APIGen).

@mahills mahills closed this as completed Aug 15, 2014
@PaulKlint
Copy link
Member Author

APIGen then at least helped to reveal some errors and we will fix it when we need it.

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