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

Aliases in function type annotations change the generated code #35

Open
tesk9 opened this issue Aug 19, 2022 · 1 comment
Open

Aliases in function type annotations change the generated code #35

tesk9 opened this issue Aug 19, 2022 · 1 comment

Comments

@tesk9
Copy link
Contributor

tesk9 commented Aug 19, 2022

When a function uses a type alias in its annotation, the generated code will use an Expression rather than the actual type.

That is, if I have a function

{-| -}
fWithoutAlias : { a : List Int } -> ()
fWithoutAlias _ =
    ()

The generated code will have the type annotation: fWithoutAlias : { a : List Int } -> Elm.Expression

but if my starting function is identical except that it uses an alias:

type alias Config =
    { a : List Int }


{-| -}
fWithAlias : Config -> ()
fWithAlias _ =
    ()

the generated code will have the type annotation fWithAlias : Elm.Expression -> Elm.Expression.

I expected the generated code to be same whether or not I referenced a type alias in the function signature.

@tesk9
Copy link
Contributor Author

tesk9 commented Aug 19, 2022

Just for clarity: what I'm trying to do is follow the UsingHelpers guide to generate code that works with published packages. I'm using code from the Gen namespace, not the code that ends up in the generated folder.

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