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

[0.16-alpha] Can't find generated function for extensible record #1088

Closed
Warry opened this issue Oct 8, 2015 · 6 comments
Closed

[0.16-alpha] Can't find generated function for extensible record #1088

Warry opened this issue Oct 8, 2015 · 6 comments
Milestone

Comments

@Warry
Copy link

Warry commented Oct 8, 2015

I don't know if this is because of my cranky environment (elm-lang/elm-repl#80), but I can't compile code using generated functions for the extensible records:

The error:

➜ elm-make Main.elm
[                                                  ] - 0 / 1
elm-make: Could not find `Foo` when solving type constraints.
elm-make: thread blocked indefinitely in an MVar operation

The sample:

type alias Foo a =
  { a | foo : String }

-- Code that breaks (each with the same error):

myFoo : Foo {}
myFoo = Foo "Hello" {}

myFoo2 : Foo { x : Int }
myFoo2 = Foo "Hello" { x = 42 }

myFoo3 : a -> Foo a
myFoo3 x = Foo "Hello" x

--

-- All the following works:

type alias Bar a =
  { a | bar : String }

myBar : Bar {}
myBar = { bar = "World!" }

type alias Baz =
  { baz : String }

myBaz : Baz
myBaz = Baz "John"

Env. : 0.16-alpha on osX 10.11
The same code works on 0.15.1

@Warry
Copy link
Author

Warry commented Oct 8, 2015

Maybe related to #953

@evancz
Copy link
Member

evancz commented Oct 8, 2015

Records with type holes no longer generate record constructors. So there should be no Foo function for creating values in the first place. Record extension literally does not exist in syntax anymore, and this is one form of it.

@Warry
Copy link
Author

Warry commented Oct 8, 2015

Ok, I'll make a PR for the update to 0.16 docs

@evancz
Copy link
Member

evancz commented Oct 8, 2015

The weird thing is that this is not a NAMING ERROR, where it cannot find Foo at the value level. I don't quite get that, and it seems like a bug.

@Warry
Copy link
Author

Warry commented Oct 8, 2015

Ok, feel free to reopen the issue if you think it's relevant.

@evancz evancz reopened this Oct 8, 2015
@evancz evancz added this to the 0.16 milestone Oct 8, 2015
@evancz evancz closed this as completed in 2667e18 Oct 8, 2015
@ccapndave
Copy link

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

3 participants