Skip to content

Commit 8d1726d

Browse files
committed
chore: improve error message for trivial bundle
1 parent 2f05ce7 commit 8d1726d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Mathlib/Geometry/Manifold/Elaborators.lean

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ scoped elab:max "T% " t:term:arg : term => do
173173
-- Check that `x` is not a bound variable in `tgt`!
174174
-- xxx: is this check fine or overzealous?
175175
if tgtHasLooseBVars then
176-
throwError "Term {tgt} depends on {x}\n\
177-
Hint: applying the `T%` elaborator twice makes no sense."
176+
throwError "Attempted to fall back to creating a section of the trivial bundle out of \
177+
({e} : {etype}) as a non-dependent function, but return type {tgt} depends on the bound
178+
variable ({x} : {base}).\nHint: applying the `T%` elaborator twice makes no sense."
178179
let trivBundle ← mkAppOptM ``Bundle.Trivial #[base, tgt]
179180
let body ← mkAppOptM ``Bundle.TotalSpace.mk' #[base, trivBundle, tgt, x, e.app x]
180181
mkLambdaFVars #[x] body

0 commit comments

Comments
 (0)