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

Error when compiling tests/list.an #38

Closed
jfecher opened this issue Jun 18, 2017 · 1 comment
Closed

Error when compiling tests/list.an #38

jfecher opened this issue Jun 18, 2017 · 1 comment
Labels
panic A panic within the compiler

Comments

@jfecher
Copy link
Owner

jfecher commented Jun 18, 2017

tests/list.an: 10,5     error: If condition's then expr's type List<'t> does not match the else expr's type List<i32>
    if l.next != void* 0 then
    ^

Type mismatch in the if expression that looks to be caused by failure to bind a generic return type in some contexts.

@jfecher jfecher added the panic A panic within the compiler label Jun 23, 2017
@ivanbakel
Copy link

To update this:

The error message on the latest version of master is

23,12-17 error: Invalid type cast i32 -> List
var head = List 0

A little bit of debugger diving got me to the point where the type system attempts to compare the type variable of List with the tuple wrapper of i32, and the result of getBindingFor gives a strange-looking TypeNode which takes its type name from the name of the elem variable.

@jfecher jfecher closed this as completed Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
panic A panic within the compiler
Projects
None yet
Development

No branches or pull requests

2 participants