fix: SubExpr.Pos.toString not terminating

fixes 1232
This commit is contained in:
E.W.Ayers 2022-06-19 15:32:56 -04:00 committed by Leonardo de Moura
parent 58d5a11928
commit b6f251bcd3
2 changed files with 3 additions and 1 deletions

View file

@ -29,7 +29,7 @@ def root : Pos := (1 : Nat)
instance : Inhabited Pos := ⟨root⟩
def isRoot (p : Pos) : Bool := p.asNat == 1
def isRoot (p : Pos) : Bool := p.asNat < maxChildren
/-- The coordinate deepest in the Pos. -/
def head (p : Pos) : Nat :=

View file

@ -17,3 +17,5 @@ theorem Pos.stringRoundtrip :
let x := Pos.ofArray p
some x == (Except.toOption $ Pos.fromString? $ Pos.toString $ x)
) := by native_decide
#eval Pos.toString Nat.zero