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

Recently introduced error: ParseTree no longer passes TC #452

Closed
PaulKlint opened this issue Dec 21, 2013 · 2 comments
Closed

Recently introduced error: ParseTree no longer passes TC #452

PaulKlint opened this issue Dec 21, 2013 · 2 comments

Comments

@PaulKlint
Copy link
Member

It seems that we have entered an unstable phase in the development since various library files that did compile fine, now suddenly give problems. Here is a first example, in our good old friend ParseTree. Compiling it

rascal>import experiments::Compiler::Compile;
ok
rascal>compile(|rascal:///ParseTree.rsc|, recompile=true);

gives

error("Name r is not in scope",|rascal:///ParseTree.rsc|(19115,1,<512,10>,<512,11>))
error("Function of type fun TreeSearchResult[&T \<: Tree](type[&T \<: Tree], loc, Tree) cannot be called with argument types (type[&T \<: Tree],loc,Tree)",|rascal:///ParseTree.rsc|(19084,17,<511,76>,<511,93>))
|rascal://experiments::Compiler::Rascal2muRascal::RascalModule|(2652,25,<80,12>,<80,37>): "Module contains errors!"

The offending code is:

public TreeSearchResult[&T<:Tree] treeAt(type[&T<:Tree] t, loc l, a:appl(_, _)) {
    if ((a@\loc)?, al := a@\loc, al.offset <= l.offset, al.offset + al.length >= l.offset + l.length) {
        for (arg <- a.args, TreeSearchResult[&T<:Tree] r:treeFound(&T<:Tree _) := treeAt(t, l, arg)) {
            return r;  <===== offending occurrence
        }

        if (&T<:Tree tree := a) {
            return treeFound(tree);
        }
    }
    return treeNotFound();
}
@PaulKlint
Copy link
Member Author

Although ParseTree.rsc seems to be the main culprit, various other libraries importing it are affected as well. My guess is that it has to do with the resolution of parameterized, overloaded functions.

Any help is welcome.

@mahills
Copy link
Member

mahills commented Dec 22, 2013

Sorry about that, this is now fixed. There was an error in the type matching code related to reified types.

@mahills mahills closed this as completed Dec 22, 2013
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