Skip to content

Commit 0817074

Browse files
committed
Restore
1 parent ef50c1f commit 0817074

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

Mathlib/Geometry/Manifold/Notation.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,8 @@ trying to determine `I` and `J` from the local context.
407407
The argument `x` can be omitted. -/
408408
scoped elab:max "CMDiffAt[" s:term "]" ppSpace nt:term:arg ppSpace f:term:arg : term => do
409409
let es ← Term.elabTerm s none
410-
let ef ← ensureIsFunction <|← Term.elabTerm f none
411410
let ne ← Term.elabTermEnsuringType nt q(WithTop ℕ∞)
411+
let ef ← ensureIsFunction <|← Term.elabTerm f none
412412
let (srcI, tgtI) ← findModels ef es
413413
mkAppM ``ContMDiffWithinAt #[srcI, tgtI, ne, ef, es]
414414

@@ -427,17 +427,17 @@ trying to determine `I` and `J` from the local context.
427427
`n` is coerced to `WithTop ℕ∞` if necessary (so passing a `ℕ`, `∞` or `ω` are all supported). -/
428428
scoped elab:max "CMDiff[" s:term "]" ppSpace nt:term:arg ppSpace f:term:arg : term => do
429429
let es ← Term.elabTerm s none
430-
let ef ← ensureIsFunction <|← Term.elabTerm f none
431430
let ne ← Term.elabTermEnsuringType nt q(WithTop ℕ∞)
431+
let ef ← ensureIsFunction <|← Term.elabTerm f none
432432
let (srcI, tgtI) ← findModels ef es
433433
mkAppM ``ContMDiffOn #[srcI, tgtI, ne, ef, es]
434434

435435
/-- `CMDiff n f` elaborates to `ContMDiff I J n f`,
436436
trying to determine `I` and `J` from the local context.
437437
`n` is coerced to `WithTop ℕ∞` if necessary (so passing a `ℕ`, `∞` or `ω` are all supported). -/
438438
scoped elab:max "CMDiff" ppSpace nt:term:arg ppSpace f:term:arg : term => do
439-
let e ← ensureIsFunction <|← Term.elabTerm f none
440439
let ne ← Term.elabTermEnsuringType nt q(WithTop ℕ∞)
440+
let e ← ensureIsFunction <|← Term.elabTerm f none
441441
let (srcI, tgtI) ← findModels e none
442442
mkAppM ``ContMDiff #[srcI, tgtI, ne, e]
443443

MathlibTest/DifferentialGeometry/Notation.lean

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,24 +541,21 @@ variable {f : M → M'} {s : Set M} {m : M}
541541

542542
variable [IsManifold I 1 M] [IsManifold I' 1 M']
543543

544-
-- TODO: can there be better error messages when forgetting the smoothness exponent?
544+
-- Testing error messages when forgetting the smoothness exponent or swapping arguments.
545545
section error
546546

547547
-- yields a parse error, "unexpected token '/--'; expected term"
548548
-- #check CMDiffAt[s] f
549549

550-
-- TODO: the old error message here was better; somehow restore it!
551-
/-
550+
/--
552551
error: Type mismatch
553552
f
554553
has type
555554
M → M'
556555
of sort `Type (max u_10 u_4)` but is expected to have type
557556
WithTop ℕ∞
558557
of sort `Type`
559-
-/
560-
561-
/--
558+
---
562559
error: Expected
563560
m
564561
of type
@@ -569,6 +566,14 @@ to be a function, or to be coercible to a function
569566
#check CMDiffAt[s] f m
570567

571568
/--
569+
error: Type mismatch
570+
f
571+
has type
572+
M → M'
573+
of sort `Type (max u_10 u_4)` but is expected to have type
574+
WithTop ℕ∞
575+
of sort `Type`
576+
---
572577
error: Expected
573578
m
574579
of type

0 commit comments

Comments
 (0)