Add failing test case for instantiation and special typing rules.
original commit: 67af968a73de3df4b86e87c71a8023bc3c929e75
This commit is contained in:
parent
160d731c4a
commit
6991bbaad0
|
@ -8,3 +8,8 @@
|
|||
|
||||
(ann (vector-ref x 1) String)
|
||||
(ann (vector-ref x y) Symbol)
|
||||
|
||||
(: ref : Integer -> (U Number String Symbol))
|
||||
(define (ref i) (vector-ref x i))
|
||||
|
||||
(ann (vector-ref #(1.0 2.0) 0) Flonum)
|
||||
|
|
10
collects/tests/typed-racket/xfail/inst+special-case.rkt
Normal file
10
collects/tests/typed-racket/xfail/inst+special-case.rkt
Normal file
|
@ -0,0 +1,10 @@
|
|||
#lang typed/racket
|
||||
|
||||
;; In tc-app, code paths for annotated operators and special case typing rules
|
||||
;; (for, e.g., `vector-ref') are mutually exclusive.
|
||||
;; The annotated operator case matches first and falls back to the regular
|
||||
;; application rules, skipping the special cases.
|
||||
;; This example, because it uses a heterogenous vector, needs the special type
|
||||
;; rule, and therefore doesn't typecheck.
|
||||
|
||||
(ann ((inst vector-ref String) #(1.0) 0) Float)
|
Loading…
Reference in New Issue
Block a user