Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Aliases in function type annotations change the generated code

Open
#35 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
elm
Domain
compilers

Research direction

No files or tests are named. Start by reproducing the issue with the two function examples in the report and trace how function annotations resolve aliases during code generation. Done means the alias and non-alias versions both generate the expected input type while retaining Elm.Expression for the return type.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Elm
Stars
144
Forks
18
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mdgriffith/elm-codegen

All issues in mdgriffith/elm-codegen

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.