Interactive: Generics fail to unify oddly-bound types
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mars |
Triaged
|
High
|
Matt Giuca |
Bug Description
In interactive mode, some fully general types (e.g. 'a') fail to unify with other types.
It appears the only case this arises is when the "other type" is a complex type with badly-bound type variables, which can only be caused by bug #418161. Therefore, solving that bug may cause this one to disappear, but I still want to investigate.
Observed behaviour:
?> a = [1,2,3]
?> :t a
a :: Array(t_1) # This is caused by bug #41861
?> show(a)
Type error in expression 'show(a)'
Term: a
Type: Array(a)
Expected: a.
Expected behaviour:
?> show(a)
[91, 49, 44, 32, 50, 44, 32, 51, 93]
Note that this bug doesn't occur for array literals:
?> show([1,2,3])
[91, 49, 44, 32, 50, 44, 32, 51, 93]
Or for properly-bound types:
def ai :: Array(Int):
return [1,2,3]
?> :t ai
ai :: Array(Int)
?> show(ai)
[91, 49, 44, 32, 50, 44, 32, 51, 93]
So it may just be a side-effect of bug #418161.
Changed in mars: | |
assignee: | nobody → Matt Giuca (mgiuca) |
importance: | Undecided → High |
status: | New → Triaged |
tags: | added: types |
Changed in mars: | |
milestone: | none → 0.3 |
Needs to be fixed (this isn't part of the type system refactor; it's a high-priority bug).