File tree Expand file tree Collapse file tree 10 files changed +121
-0
lines changed
Expand file tree Collapse file tree 10 files changed +121
-0
lines changed Original file line number Diff line number Diff line change 1+ #;
2+ (exn-pred #rx"expected single value, got multiple " )
3+ #lang typed/racket
4+
5+ ;; Issue #1028: Incorrect with-handlers usage previously caused an internal
6+ ;; typechecker error "get-range-result: should not happen". Fixed to give
7+ ;; a proper type error about expecting single value.
8+
9+ (with-handlers ([exn:fail? (values #f #f )]) (values #t #t ))
Original file line number Diff line number Diff line change 1+ #;
2+ (exn-pred #rx"Inference for polymorphic keyword functions not supported " )
3+ #lang typed/racket
4+
5+ ;; Issue #1268: hash-union with #:combine previously caused an internal
6+ ;; match-define error. Fixed to give a proper type error about polymorphic
7+ ;; keyword function inference.
8+
9+ (require racket/hash)
10+
11+ (hash-union (make-hash) (make-hash) #:combine (lambda (a b) a))
Original file line number Diff line number Diff line change 1+ #;
2+ (exn-pred #rx"broke its own contract " )
3+ #lang typed/racket
4+
5+ ;; Issue #368: cast with wrong type previously threw an internal error
6+ ;; "procedure-arity: contract violation" instead of a proper contract failure.
7+
8+ (cast 3 (-> Integer Integer))
Original file line number Diff line number Diff line change 1+ #;
2+ (exn-pred #rx"cannot apply a non-polymorphic type " )
3+ #lang typed/racket
4+
5+ ;; Issue #425: Regression test - previously caused internal error
6+ ;; "Base type L+ not in predefined-type-table" when using recursive
7+ ;; type definitions with intersection types incorrectly.
8+
9+ (define-type (L+ T REST) (Pairof T (∩ (L+ T Any) REST)))
Original file line number Diff line number Diff line change 1+ #;
2+ (exn-pred #rx"cannot apply a non-polymorphic type " )
3+ #lang typed/racket
4+
5+ ;; Issue #658: Invalid *-> type previously caused an internal error
6+ ;; "erroneous syntax was not a syntax object". Fixed to give a proper
7+ ;; type error about applying a non-polymorphic type.
8+
9+ (struct Node [{reachable : Edge}])
10+ (struct Edge [{to : Symbol} {cost : Positive-Integer}])
11+
12+ (define-type Graph [Immutable-HashTable Symbol Node])
13+
14+ (: make-graph (Node *-> Graph))
15+ (define (make-graph . lo-node)
16+ (make-immutable-hash))
Original file line number Diff line number Diff line change 1+ #lang typed/racket
2+
3+ ;; Issue #1144: Referencing certain identifiers like exn:srclocs? previously
4+ ;; caused an internal "syntax-property: contract violation" error.
5+ ;; Now properly returns the procedure.
6+
7+ (ann exn:srclocs? (-> Any Boolean))
8+ (ann rename-transformer? (-> Any Boolean))
9+ (ann set!-transformer? (-> Any Boolean))
Original file line number Diff line number Diff line change 1+ #lang typed/racket
2+
3+ ;; Issue #229: Typed units with signatures from submodules previously
4+ ;; caused a "free-id-table-ref: contract violation" internal error.
5+ ;; Now type checks correctly.
6+
7+ (module a typed/racket
8+ (provide foo^)
9+
10+ (define-signature foo^
11+ ([some-class% : ClassTop])))
12+
13+ (require 'a )
14+
15+ (define-unit foo@
16+ (import )
17+ (export foo^)
18+
19+ (define some-class%
20+ (class object%
21+ (super-new ))))
Original file line number Diff line number Diff line change 1+ #lang typed/racket
2+
3+ ;; Issue #318: Regression test - previously caused internal error when overriding
4+ ;; a method that returns multiple values including 'this'.
5+ ;; This was fixed in an earlier version of Typed Racket.
6+
7+ (define atree%
8+ (class object%
9+ (super-new )
10+ (define/public (m)
11+ (values #f this ))))
12+
13+ (define state%
14+ (class atree%
15+ (super-new )
16+ (define/override (m)
17+ (values #f this ))))
Original file line number Diff line number Diff line change 1+ #lang typed/racket
2+
3+ ;; Issue #378: cast in dead code previously caused an internal error
4+ ;; "contract-def-property: thunk called too early". Now works correctly.
5+
6+ (define result
7+ (cond [#false (cast 1 Integer)]
8+ [else 2 ]))
9+
10+ (unless (= result 2 )
11+ (error "expected 2 " ))
Original file line number Diff line number Diff line change 1+ #lang typed/racket
2+
3+ ;; Issue #82: Previously caused internal error "Tried to move vars to
4+ ;; dbound that already exists" when using plambda with dotted type
5+ ;; variables. Now type checks correctly.
6+
7+ (: f (-> One (List One String Char) : #:object (0 0 )))
8+ (define (f [x : One])
9+ (let ([f (plambda: (a ... ) [w : a ... a] w)])
10+ (f x "hello " #\c )))
You can’t perform that action at this time.
0 commit comments