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

Internal type error regarding internalisation #938

Closed
Unigurd opened this issue Apr 26, 2020 · 0 comments
Closed

Internal type error regarding internalisation #938

Unigurd opened this issue Apr 26, 2020 · 0 comments

Comments

@Unigurd
Copy link

Unigurd commented Apr 26, 2020

I get a compile error when I try to compile the following with futhark c:

type sometype 't = #someval t
entry crash : sometype ([]i32) = #someval [1]

The error message is as follows:

Warning at bug.fut:2:1-45:
  Entry point return type
  
    #someval [1]i32
  
  will have an opaque type, so the result will likely not be usable.
Internal compiler error.
Please report this at https://github.com/diku-dk/futhark/issues.
After internalisation:
In function crash
Type error:
payload_4041 was invalidly consumed.
Nothing can be consumed here.

If I change sometype to sometype 't = t and all instances of constructor #someval, then I simply get a normal type error.

Additionally, the following will also crash when I try to load it into futhark repl:

type sometype 't = #someval t

let unwrap 't (n : sometype t) : t
  = match n case #someval m -> m

let geni32 (maxsize : i32) : sometype i32 = #someval maxsize

let genarr 'elm
           (genelm: i32 -> sometype elm)
           (ownsize : i32)
           : sometype ([ownsize]elm) =
  let rngs = replicate ownsize ownsize
  in #someval (map (unwrap <-< genelm) rngs)

entry crash : sometype ([][]i32)=
  genarr (genarr geni32) 1

The error message:

Loading bug.fut
Warning at bug.fut:15:1-16:26:
  Entry point return type
  
    #someval [1][1]i32
  
  will have an opaque type, so the result will likely not be usable.

Internal compiler error (unhandled IO exception).
Please report this at https://github.com/diku-dk/futhark/issues
Bad return type: *[][ownsize]i32
CallStack (from HasCallStack):
  error, called at src/Language/Futhark/Interpreter.hs:1312:15 in futhark-0.16.0-5e4b2caa8c56347058172608c41910e8fcef137fed5a05bf88d6af351cfcef7:Language.Futhark.Interpreter                                   

This one stop crashing if I change the body of crash to genarr geni32 1 and its type accordingly.

athas added a commit that referenced this issue Apr 27, 2020
@athas athas closed this as completed in 96941bd Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant