chore: break up universe level error message (#9637)
This PR improves the readability of the "maximum universe level offset exceeded" error message.
This commit is contained in:
parent
b8e801ecad
commit
3a3c816a27
2 changed files with 9 additions and 3 deletions
|
|
@ -56,7 +56,9 @@ register_builtin_option maxUniverseOffset : Nat := {
|
|||
private def checkUniverseOffset [Monad m] [MonadError m] [MonadOptions m] (n : Nat) : m Unit := do
|
||||
let max := maxUniverseOffset.get (← getOptions)
|
||||
unless n <= max do
|
||||
throwError "maximum universe level offset threshold ({max}) has been reached, you can increase the limit using option `set_option maxUniverseOffset <limit>`, but you are probably misusing universe levels since offsets are usually small natural numbers"
|
||||
throwError m!"Universe level offset `{n}` exceeds maximum offset `{max}`"
|
||||
++ .note m!"This code is probably misusing universe levels, since they are usually small natural numbers. \
|
||||
If you are confident this is not the case, you can increase the limit using `set_option maxUniverseOffset <limit>`"
|
||||
|
||||
partial def elabLevel (stx : Syntax) : LevelElabM Level := withRef stx do
|
||||
let kind := stx.getKind
|
||||
|
|
|
|||
|
|
@ -1,2 +1,6 @@
|
|||
bigUnivOffsets.lean:1:12-1:21: error: maximum universe level offset threshold (32) has been reached, you can increase the limit using option `set_option maxUniverseOffset <limit>`, but you are probably misusing universe levels since offsets are usually small natural numbers
|
||||
bigUnivOffsets.lean:5:13-5:25: error: maximum universe level offset threshold (32) has been reached, you can increase the limit using option `set_option maxUniverseOffset <limit>`, but you are probably misusing universe levels since offsets are usually small natural numbers
|
||||
bigUnivOffsets.lean:1:12-1:21: error: Universe level offset `100000000` exceeds maximum offset `32`
|
||||
|
||||
Note: This code is probably misusing universe levels, since they are usually small natural numbers. If you are confident this is not the case, you can increase the limit using `set_option maxUniverseOffset <limit>`
|
||||
bigUnivOffsets.lean:5:13-5:25: error: Universe level offset `10000000` exceeds maximum offset `32`
|
||||
|
||||
Note: This code is probably misusing universe levels, since they are usually small natural numbers. If you are confident this is not the case, you can increase the limit using `set_option maxUniverseOffset <limit>`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue