This PR improves pretty printing of level metavariables: they now print with a per-definition index rather than their per-module internal identifiers. Furthermore, `+` is printed uniformly in level expressions with surrounding spaces. **Breaking metaprogramming change:** level pretty printing should use `delabLevel` or `MessageData.ofLevel`; functions such as `format` or `toString` do not have access to the indices, since they are stored in the current metacontext. Absent index information, metavariables print with the raw internal identifier as `?_mvar.nnn`. **Note:** The heartbeat counter also increases quicker due to counting allocations that record level metavariable indices. In some tests we needed to increase `maxHeartbeats` by 20–50% to compensate, without a corresponding slowdown.
41 lines
1.7 KiB
Text
41 lines
1.7 KiB
Text
ctorUnivTooBig.lean:3:2-3:45: error: Invalid universe level in constructor `Bla.cons`: Parameter `α` has type
|
||
Type u
|
||
at universe level
|
||
u + 2
|
||
which is not less than or equal to the inductive type's resulting universe level
|
||
u + 1
|
||
ctorUnivTooBig.lean:7:2-7:25: error: Invalid universe level in constructor `Foo.mk`: Parameter `α` has type
|
||
Type
|
||
at universe level
|
||
2
|
||
which is not less than or equal to the inductive type's resulting universe level
|
||
1
|
||
ctorUnivTooBig.lean:12:2-12:47: error: Invalid universe level in constructor `Foo'.mk`: Parameter has type
|
||
Sort (max u v)
|
||
at universe level
|
||
max (u + 1) (v + 1)
|
||
which is not less than or equal to the inductive type's resulting universe level
|
||
u + 1
|
||
ctorUnivTooBig.lean:17:2-17:35: error: Constructor field `a` of `Foo''.mk` contains universe level metavariables at the expression
|
||
Sort ?u
|
||
in its type
|
||
Sort ?u
|
||
Ex1.Member.head.{u} {α : Type u} {a : α} {as : List α} : Member a (a :: as)
|
||
ctorUnivTooBig.lean:40:2-40:27: error: Invalid universe level in constructor `Ex3.Member.head`: Parameter `as` has type
|
||
List α
|
||
at universe level
|
||
u_1 + 1
|
||
which is not less than or equal to the inductive type's resulting universe level
|
||
max (u + 1) (v + 1)
|
||
ctorUnivTooBig.lean:46:2-46:27: error: Invalid universe level in constructor `Ex4.Member.head`: Parameter `as` has type
|
||
List α
|
||
at universe level
|
||
u_1 + 1
|
||
which is not less than or equal to the inductive type's resulting universe level
|
||
u + 2
|
||
ctorUnivTooBig.lean:52:2-52:27: error: Invalid universe level in constructor `Ex5.Member.head`: Parameter `as` has type
|
||
List α
|
||
at universe level
|
||
u_1 + 1
|
||
which is not less than or equal to the inductive type's resulting universe level
|
||
2
|