gren-lang / gren-lang/compiler

Unit type should not be treated as extensible record?

Open
#286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
503
Forks
29
PR merge metrics
No merged PRs in 30d

Description

If the init field in the Browser.element record has a function with the union type {} as input for the flags, the type checker complains about a type mismatch of an extensible record. But by declaring the type of the main function as main : Program {} Model Msg this error is solved and the code compiles. See also screenshots:

Image

image

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the type-checker error in the Browser.element init field when the flags input uses the union type {} and compare it with the workaround main : Program {} Model Msg. Trace how the compiler distinguishes unit types from extensible records, then verify that the original program compiles without the workaround.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.