You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extensible records aren't typechecked properly. The language server throws errors where the the elm compiler does not, and vice versa.
I found two different kinds of errors do let me know if you'd like me to split into multiple issues.
Expected Behavior
Unbound type variables
The following two examples should error because unbound type variables are used:
type Example=Example{ a | foo :Float}
type alias Example={ a | foo :Float}
An error similar to the elm compiler one should be thrown:
The `Example` type alias uses an unbound type variable `a` in its definition:
8| type alias Example = { a | foo : Float }
^
You probably need to change the declaration to something like this:
type alias Example a = ...
Why? Well, imagine one `Example` where `a` is an Int and another where it is a
Bool. When we explicitly list the type variables, the type checker can see that
they are actually different types.
Incorrect type inference
This shouldn't error as elm compiler typechecks it fine:
type Example a =Example{ a | foo :Float}example:Example {}
example =Example{ foo =0}
Current Behavior
Unbound type variables
The following two examples throw no errors, despite use of unbound type variables.
type Example=Example{ a | foo :Float}
type alias Example={ a | foo :Float}
Incorrect type inference
The following example...
type Example a =Example{ a | foo :Float}example:Example {}
example =Example{ foo =0}
I have a project that compiles fine, but when trying to move to using VSCode errors are shown for code that compiles fine. This project is open source, so here is an example file with errors.
Your Environment
Version used: 2.4.0
Editor used: Elm Plugin for Visual Studio Code
Environment name and version : node v12.22.5
Operating System and version: Ubuntu 21.10
The text was updated successfully, but these errors were encountered:
Extensible records aren't typechecked properly. The language server throws errors where the the elm compiler does not, and vice versa.
I found two different kinds of errors do let me know if you'd like me to split into multiple issues.
Expected Behavior
Unbound type variables
The following two examples should error because unbound type variables are used:
An error similar to the elm compiler one should be thrown:
Incorrect type inference
This shouldn't error as elm compiler typechecks it fine:
Current Behavior
Unbound type variables
The following two examples throw no errors, despite use of unbound type variables.
Incorrect type inference
The following example...
...shows the following error...
...when it should typecheck fine.
Context
I have a project that compiles fine, but when trying to move to using VSCode errors are shown for code that compiles fine. This project is open source, so here is an example file with errors.
Your Environment
The text was updated successfully, but these errors were encountered: