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

Qualified names can not be used as type constructor arguments in case statements. #951

Closed
lachenmayer opened this issue May 31, 2015 · 3 comments

Comments

@lachenmayer
Copy link

Bar.elm:

module Bar where

type Action = Baz | Qux

Foo.elm:

module Foo where

import Bar exposing (Action(Qux))

type Action = NoOp | BarAction Bar.Action

foo : Action -> Int
foo action =
  case action of
    NoOp -> 0
    BarAction Bar.Baz -> 1 -- ERROR!
    BarAction Qux -> 2 -- works

faa : Bar.Action -> Int
faa action =
  case action of
    Bar.Baz -> 0 -- works
    Bar.Qux -> 1 -- works

Compilation result:

Error in Foo.elm:

Parse error at (line 11, column 18):
unexpected "."
expecting whitespace, a newline, pattern, cons operator '::' or arrow (->)

Expected behaviour:
BarAction Bar.Baz should match without error.

@sindikat
Copy link

Qualified imports are also a problem in record updates.

@evancz
Copy link
Member

evancz commented May 12, 2016

Should be fixed in 0.17

@evancz evancz closed this as completed May 12, 2016
@evancz
Copy link
Member

evancz commented May 12, 2016

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants