Aliases in function type annotations change the generated code
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mdgriffith/elm-codegen
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mdgriffith/elm-codegen#107 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
mdgriffith/elm-codegen#106 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
mdgriffith/elm-codegen#90 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
mdgriffith/elm-codegen#68 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mdgriffith/elm-codegen#60 ·
All issues in mdgriffith/elm-codegen
Similar issues
-
bug engine spec compliance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
frostney/GocciaScript#1737 ·
Maintainers usually reply within 1 day
-
bug frontend rt sev-3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area:adapters duckdb engine:v2 status:triage triage type:bug v2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
qualcomm/hexagon-mlir#108 ·