Idris2/tests/idris2/coverage004/expected
Edwin Brady 97ee3d4cd3 Check LHS arguments are polymorphic enough
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!
2021-06-13 13:31:40 +01:00

15 lines
382 B
Plaintext

1/1: Building Cover (Cover.idr)
Error: While processing left hand side of bad. Can't match on Just (fromInteger 0) as it must have a polymorphic type.
Cover:14:6--14:12
10 |
11 | bad : a -> Foo a -> Bool
12 | bad Z IsNat = False
13 | bad True IsBool = True
14 | bad (Just 0) _ = False
^^^^^^
Main> Main.okay: okay (S _) IsNat
okay False IsBool
Main> Bye for now!