mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-09-11 13:36:08 +03:00
[ fix ] issue 3266
This commit is contained in:
parent
517b2832ef
commit
e1c5c2fd8e
@ -230,8 +230,9 @@ finFromInteger x = natToFinLt (fromInteger x)
|
||||
-- even when the function is unused (issue #2032)
|
||||
public export
|
||||
integerLessThanNat : Integer -> Nat -> Bool
|
||||
integerLessThanNat 0 (S m) = True
|
||||
integerLessThanNat x n with (x < the Integer 0)
|
||||
integerLessThanNat _ _ | True = True -- if `x < 0` then `x < n` for any `n : Nat`
|
||||
integerLessThanNat _ _ | True = False -- don't support negative literals
|
||||
integerLessThanNat x (S m) | False = integerLessThanNat (x-1) m -- recursive case
|
||||
integerLessThanNat x Z | False = False -- `x >= 0` contradicts `x < Z`
|
||||
|
||||
|
@ -20,3 +20,8 @@ eq1 = Refl
|
||||
-- and anybody measures the time it takes this test to run...
|
||||
addFourMillion : Int -> Int
|
||||
addFourMillion x = 4000000 + x
|
||||
|
||||
-- issue #3266
|
||||
failing
|
||||
fin0 : Fin 0
|
||||
fin0 = (-1)
|
||||
|
Loading…
Reference in New Issue
Block a user