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 compiler error #1232

Closed
nqpz opened this issue Jan 23, 2021 · 1 comment
Closed

Internal compiler error #1232

nqpz opened this issue Jan 23, 2021 · 1 comment

Comments

@nqpz
Copy link
Member

nqpz commented Jan 23, 2021

The program

type option 'a = #some a | #none

let bind 'a 'b (m: option a) (f: a -> option b): option b =
  match m
  case #none -> #none
  case #some a -> f a

entry foo (n: i32): bool =
  match bind (if n == 0 then #some () else #none)
             (\() -> #some true)
  case #some res -> res
  case #none -> true

produces the error

processFlatPattern: insufficient identifiers in pattern.([Ident {identName = VName (Name "nameless") 3915, identType = Info {unInfo = Scalar (Prim Bool)}, identSrcLoc = noLoc}],[])
CallStack (from HasCallStack):
  error, called at src/Futhark/Internalise/Bindings.hs:96:7 in futhark-0.19.0-2V6GCosZ0r28tYyck4f4gH:Futhark.Internalise.Bindings

when run with futhark c from git.

@athas
Copy link
Member

athas commented Jan 23, 2021

Simpler case:

let main (x: i32) =
  match ()
  case () -> x

I wonder how we never noticed this before.

@athas athas closed this as completed in b2306bb Jan 23, 2021
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

2 participants