Skip to content

Commit 30174e5

Browse files
committed
More tests for bad or confusing error messages!
1 parent 2c8c682 commit 30174e5

1 file changed

Lines changed: 46 additions & 1 deletion

File tree

Mathlib/Geometry/Manifold/IsImmersionEmbedding.lean

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,52 @@ namespace IsImmersion
333333

334334
open Manifold
335335

336-
variable {f g : M → N}
336+
variable {f g : M → N} {x : M}
337+
338+
-- TODO: why is this error? this should not be!
339+
/--
340+
error: Function expected at
341+
F
342+
but this term has type
343+
Type u_6
344+
345+
Note: Expected a function because this term is being applied to the argument
346+
f
347+
---
348+
info: IsImmersionAt % sorry : ?m.45
349+
-/
350+
#guard_msgs in
351+
#check IsImmersionAt% F f x
352+
-- Much better error message; TODO say something similar!
353+
/--
354+
error: Application type mismatch: The argument
355+
f
356+
has type
357+
M → N
358+
of sort `Type (max u_12 u_14)` but is expected to have type
359+
WithTop ℕ∞
360+
of sort `Type` in the application
361+
IsImmersionAt F I J f
362+
-/
363+
#guard_msgs in
364+
#check IsImmersionAt F I J f x
365+
366+
-- TODO: why does this error? I'm really confused now...
367+
/--
368+
error: Function expected at
369+
F
370+
but this term has type
371+
Type u_6
372+
373+
Note: Expected a function because this term is being applied to the argument
374+
n
375+
---
376+
info: IsImmersionAt % sorry : ?m.45
377+
-/
378+
#guard_msgs in
379+
#check IsImmersionAt% F n f x
380+
381+
#check IsImmersionAt F I J n f x
337382

338383
/-- If `f` is an immersion, it is an immersion at each point. -/
339384
lemma isImmersionAt (h : IsImmersion F I J n f) (x : M) : IsImmersionAt F I J n f x := h x

0 commit comments

Comments
 (0)