mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-15 14:23:32 +03:00
97ee3d4cd3
We already did this, but missed a few cases due to the way arguments are elaborated. So now, when checking an LHS, we don't allow LHS argument types to be inferred from the pattern, but rather they must be inferred from elsewhere. To do this, we keep track of the constraints which would be solved when inferring the type, and make sure they don't solve any new metavariables. Fixes #1510, and also now gets the error location right as a bonus!
19 lines
490 B
Plaintext
19 lines
490 B
Plaintext
1/1: Building tuple (tuple.idr)
|
|
Error: While processing left hand side of tupleBug. Can't match on (?_, ?_) as it must have a polymorphic type.
|
|
|
|
tuple:2:15--2:19
|
|
1 | tupleBug : Pair () a -> ()
|
|
2 | tupleBug (_, (_, _)) = ()
|
|
^^^^
|
|
|
|
Error: While processing left hand side of odd. Can't match on () as it must have a polymorphic type.
|
|
|
|
tuple:5:5--5:7
|
|
1 | tupleBug : Pair () a -> ()
|
|
2 | tupleBug (_, (_, _)) = ()
|
|
3 |
|
|
4 | odd : a -> Bool
|
|
5 | odd () = False
|
|
^^
|
|
|