gren-lang / gren-lang/compiler
Unit type should not be treated as extensible record?
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:
Contributor guide
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.
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