Allow flvectors/fxvectors in Any contract
Closes PR 14374
This commit is contained in:
parent
8b4c5d3deb
commit
5c7046cab3
|
@ -1,6 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require racket/match racket/contract/base racket/contract/combinator
|
(require racket/match racket/contract/base racket/contract/combinator
|
||||||
|
racket/fixnum racket/flonum
|
||||||
racket/set
|
racket/set
|
||||||
(only-in (combine-in racket/private/promise)
|
(only-in (combine-in racket/private/promise)
|
||||||
promise?
|
promise?
|
||||||
|
@ -11,7 +12,11 @@
|
||||||
(define (base-val? e)
|
(define (base-val? e)
|
||||||
(or (number? e) (string? e) (char? e) (symbol? e)
|
(or (number? e) (string? e) (char? e) (symbol? e)
|
||||||
(null? e) (regexp? e) (eq? undef e) (path? e)
|
(null? e) (regexp? e) (eq? undef e) (path? e)
|
||||||
(regexp? e) (keyword? e) (bytes? e) (boolean? e) (void? e)))
|
(regexp? e) (keyword? e) (bytes? e) (boolean? e) (void? e)
|
||||||
|
;; Base values because you can only store flonums/fixnums in these
|
||||||
|
;; and not any higher-order values. This isn't sound if we ever
|
||||||
|
;; introduce bounded polymorphism for Flvector/Fxvector.
|
||||||
|
(flvector? e) (fxvector? e)))
|
||||||
|
|
||||||
(define (val-first-projection b)
|
(define (val-first-projection b)
|
||||||
(define (fail neg-party v)
|
(define (fail neg-party v)
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
#lang typed/racket
|
||||||
|
|
||||||
|
;; Test for PR 14374. Ensure that flvector is okay for Any
|
||||||
|
|
||||||
|
(require typed/rackunit
|
||||||
|
racket/fixnum
|
||||||
|
racket/flonum)
|
||||||
|
|
||||||
|
(check-equal? (flvector 0.0) (flvector 0.0))
|
||||||
|
(check-equal? (fxvector 0) (fxvector 0))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user