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

Addition inside a polymorphic function #464

Closed
Anastassija opened this issue Dec 28, 2013 · 0 comments
Closed

Addition inside a polymorphic function #464

Anastassija opened this issue Dec 28, 2013 · 0 comments
Assignees

Comments

@Anastassija
Copy link
Contributor

The following example crashes:

import Exception;
import List;

list[&T] f(list[&T] l) {
    return head(l) + l;
}

value main(list[value] args) {
    return f([1,2,3]);
}

This is due to the addition expression head(l) + l. The add Rascal primitive is called and leads to an exception (see the improved exception message below):

|rascal://experiments::Compiler::RVM::Run|(217,618,<12,0>,<22,28>): Java("RuntimeException","PANIC: (instruction execution): instruction: CALLPRIM add, 2; message: null",Java("RuntimeException","Illegal type combination: INT and LIST"))
    at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVM.executeProgram(|file:///RVM.java|(0,0,<1495,0>,<1495,0>))
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