lean4-htt/tests/lean/doNotation1.lean.expected.out
Joachim Breitner 8424ddbb3e
feat: prettier expected type mismatch error message (#9099)
This PR improves the “expected type mismatch” error message by omitting
the type's types when they are defeq, and putting them into separate
lines when not.

I found it rather tediuos to parse the error message when the expected
type is long, because I had to find the `:` in the middle of a large
expression somewhere. Also, when both are of sort `Prop` or `Type` it
doesn't add much value to print the sort (and it’s only one hover away
anyways).
2025-07-01 07:50:53 +00:00

36 lines
1.7 KiB
Text

doNotation1.lean:4:0-4:6: error: `y` cannot be mutated, only variables declared using `let mut` can be mutated. If you did not intend to mutate but define `y`, consider using `let y` instead
doNotation1.lean:8:2-8:18: error: `y` cannot be mutated, only variables declared using `let mut` can be mutated. If you did not intend to mutate but define `y`, consider using `let y` instead
doNotation1.lean:12:2-12:17: error: `p` cannot be mutated, only variables declared using `let mut` can be mutated. If you did not intend to mutate but define `p`, consider using `let p` instead
doNotation1.lean:20:7-20:23: error: invalid reassignment, value has type
Vector' Nat (n + 1)
but is expected to have type
Vector' Nat n
doNotation1.lean:25:7-25:11: error: invalid reassignment, value has type
Bool
but is expected to have type
Nat
doNotation1.lean:24:0-25:11: error: type mismatch, `for` has type
PUnit
but is expected to have type
List Bool
doNotation1.lean:28:0-29:14: error: type mismatch, `for` has type
PUnit
but is expected to have type
List Nat
doNotation1.lean:33:2-33:7: error: invalid `do` element, it must be inside `for`
doNotation1.lean:37:2-37:10: error: invalid `do` element, it must be inside `for`
doNotation1.lean:40:0-40:9: error: must be last element in a `do` sequence
def f10 : Nat → IO Unit :=
fun x => IO.println x
doNotation1.lean:51:0-51:13: error: type mismatch
IO.mkRef true
has type
BaseIO (IO.Ref Bool)
but is expected to have type
IO Unit
doNotation1.lean:58:2-58:20: error: type mismatch, result value has type
Unit
but is expected to have type
Bool
doNotation1.lean:66:0-66:18: error: `do` element is unreachable
doNotation1.lean:70:0-70:32: error: `do` element is unreachable