fix type of integer-bytes->integer
and the corresponding tests
This commit is contained in:
parent
55114e298e
commit
4bf6961551
|
@ -311,11 +311,8 @@
|
|||
[integer->integer-bytes (-Integer index-type Univ [Univ -Bytes index-type] . ->opt . -Bytes)]
|
||||
[integer-bytes->integer
|
||||
(cl->*
|
||||
;; Any truthy value (not only #t) would work here.
|
||||
;; We can define a truthy type (without difference types (- Univ #f))
|
||||
;; by unioning everything (including StructTop and co).
|
||||
;; We should do this at some point.
|
||||
(-Bytes (-val #t) [Univ index-type index-type] . ->opt . -Nat)
|
||||
;; Second argument is `signed?` --- if `#false` the result is a `-Nat`
|
||||
(-Bytes (-val #f) [Univ index-type index-type] . ->opt . -Nat)
|
||||
(-Bytes Univ [Univ index-type index-type] . ->opt . -Integer))]
|
||||
|
||||
[peek-char
|
||||
|
|
|
@ -664,8 +664,8 @@
|
|||
(when (boolean? x) #t))
|
||||
-Void]
|
||||
|
||||
[tc-e (integer-bytes->integer '#"abcd" #t) -Nat]
|
||||
[tc-e (integer-bytes->integer '#"abcd" #f) -Int]
|
||||
[tc-e (integer-bytes->integer '#"abcd" #t) -Int]
|
||||
[tc-e (integer-bytes->integer '#"abcd" #f) -Nat]
|
||||
|
||||
[tc-e/t (let: ([x : Any 3])
|
||||
(if (list? x)
|
||||
|
|
Loading…
Reference in New Issue
Block a user