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
$ elm-repl
> f1 = (<)
<function> : comparable -> comparable -> Bool
> f2 = (<) 1
<function> : comparable -> Bool
> f2 "a"
As I infer the type of values flowing through your program, I see a conflict
between these two types:
comparable
String
Expected behaviour: f2 : number -> Bool (or perhaps Int, I don't know exactly what the compiler does there).
Thanks for describing this. Seems separate from #1008, looks like a bug instead. It is closer to #880 which seems to stem from the same code.
I suspect the root issue arises from this function or from this section. If someone could take a look, it may not be too crazy to find the root issue here.
- Get rid of pretty printing for Type.Type
- Stop modeling records with overlapping fields in Type.Type
- Explicit exports for Type.Environment
- Make type Mismatch notes an ADT not a String
- Track expected/actual through the unification process
Errors still print out weird. Next task is to clean that up!
This also appears to resolve issues #1013, #917, #821, #656, and #654.
We should do further testing before closing them all though!
Alright, this is resolved on the type-fixes branch which I am currently merging into master. So it'll be out with 0.16 and I'll try to do an alpha soon. Here's what I'm seeing now:
$ elm-repl
---- elm repl 0.16.0 -----------------------------------------------------------
:help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> (<)
<function> : comparable -> comparable -> Bool
> isNegative n = n < 0
<function> : number -> Bool
> isPositive = (<) 0
<function> : number -> Bool
>
Another issue to be aggregated in #1008?
Observe:
Expected behaviour:
f2 : number -> Bool
(or perhapsInt
, I don't know exactly what the compiler does there).Original data comes from this StackOverflow question.
The text was updated successfully, but these errors were encountered: