Code Monkey home page Code Monkey logo

typed-racket's Introduction

Typed Racket

Build Status Racket Discourse users Racket Discord

Typed Racket is Racket's gradually-typed sister language which lets you add statically-checked type annotations to your programs. For more information, see the Typed Racket Guide.

Installation

Typed Racket is bundled in the default Racket distribution, which you can download from Racket's download page.

You can also manually install it from the main package catalog with the following command:

raco pkg install typed-racket

Documentation

The documentation is also bundled in your local copy of Typed Racket.

Directory Guide

The directory rfcs holds requests for changes to Typed Racket.

The directory source-syntax allows the source-syntax collection to report errors in macro-expanded code by mapping each location in the expanded code to the right location in the source file.

The directory typed-racket bundles together the Racket content of the two directories typed-racket-doc and typed-racket-lib.

The directory typed-racket-compatibility provides Typed Racket under old names for backwards compatibility.

The directory typed-racket-doc contains Scribble documentation.

The directory typed-racket-lib houses the actual implementation of Typed Racket.

The directory typed-racket-more has typed interfaces for additional libraries.

The directory typed-racket-test has test cases for Typed Racket.

License

Racket, including these packages, is free software, see LICENSE for more details.

By making a contribution, you are agreeing that your contribution is licensed under the Apache 2.0 license and the MIT license.

typed-racket's People

Contributors

alexknauth avatar bdeket avatar bennn avatar btlachance avatar capfredf avatar carl-eastlund avatar dependabot[bot] avatar dfeltey avatar elibarzilay avatar endobson avatar florence avatar jackfirth avatar jbclements avatar lexi-lambda avatar liberalartist avatar mflatt avatar noahstorym avatar rfindler avatar rmculpepper avatar samth avatar shhyou avatar sorawee avatar sstrickl avatar stamourv avatar stchang avatar suzannesoy avatar takikawa avatar tonyg avatar wargrey avatar yjqww6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

typed-racket's Issues

Optimizations missed on List types with recursive members

In the sample below, the TR optimizer will reach the first (car x) but not the other two, even though all three types guarantee that a first member will exist.

#lang typed/racket

(define-type foo (List Symbol Any))

(: foo-car (foo . -> . Symbol))
(define (foo-car x)
  (car x)) ; optimized


(define-type bar (List Symbol (U String bar)))

(: bar-car (bar . -> . Symbol))
(define (bar-car x)
  (car x)) ; not optimized


(define-type zam (Rec z (List Symbol (U String z))))

(: zam-car (zam . -> . Symbol))
(define (zam-car x)
  (car x)) ; not optimized

typed/racket internal error

Originally submitted on: Wed Jan 21 10:48:01 -0500 2015
The program below signals the following error: 

plt/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/error-message.rkt:69:2: match-define: no matching clause for Error

Removing the two % chars eliminates the errors (and type checks the fragment).
Steps to Reproduce:
#lang typed/racket

(define-type Manage
  (Class 
   (field [mbta-subways [Instance MBTA]])
   [find (-> String String String)]))

(define-type MBTA
  (Class [find-path (-> String String [Listof Path])]))

(: read-t-graph (-> [Instance MBTA%]))
(define (read-t-graph)
  (new (class object% (super-new) [define/public (find-path x y) '()])))

(: manage% Manage)
(define manage%
  (class object% 
    (super-new)

    (field [mbta-subways : [Instance MBTA%] (read-t-graph)])

    [define/public (find x y) "hello world, good bye dreary world"]))
Release:
6.1.1.8--2015-01-03(-/f)
Environment:
macosx "Darwin antarctica.ccs.neu.edu 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29
 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64" (x86_64-macosx/3m)
 (get-display-depth) = 32
Human Language: english
(current-memory-use) 599687732
raco pkg (show):
Installation-wide:
 Package                 Checksum     Source
 ansi                    2770248a...  catalog ansi
 github://github.com/tonyg/racket-ansi/master
 benchmark               45992763...  catalog benchmark
 git://github.com/stamourv/racket-benchmark#master
 graph                   9528fd5f...  catalog graph
 github://github.com/stchang/graph/master
 honu                    6a982c11...  catalog honu git://github.com/racket/honu
 htdp                    76ca9ca3...  clone /Users/matthias/plt/extra-pkgs/htdp/htdp
 git://github.com/racket/htdp/?path=htdp
 main-distribution       67868e03...  catalog main-distribution
 git://github.com/racket/main-distribution
 main-distribution-test  ca4a870e...  catalog main-distribution-test
 git://github.com/racket/main-distribution-test
 marketplace             e48aabc2...  catalog marketplace
 github://github.com/tonyg/marketplace/typeless
 minimart                234ba0d4...  catalog minimart git://github.com/tonyg/minimart
 racket-lib                           static-link /Users/matthias/plt/pkgs/racket-lib
 rackunit                466a679c...  clone
 /Users/matthias/plt/extra-pkgs/rackunit/rackunit
 git://github.com/racket/rackunit/?path=rackunit
 [217 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/Users/matthias/0Unison/collects/"
 (".DS_Store" "compiled" "date" "finance" "info-domain" "info.ss" "pdf.ss~" "session"
 "short" "testing" "tll-collects" "utils" "web"))
("/Users/matthias/Library/Racket/development/collects"
 (non-existent-path))
("/Users/matthias/plt/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 debug) (default) #() "#lang racket" #t #t ((test) (main)) #t))
This bug was converted from Gnats bug 14942.

is it possible (or even sensible) to make unit tests for typechecking?

What’s the best practice for writing unit tests for typing? For instance when I’m using typed/rackunit, I’ve wondered if I can make checks for types that are analogous to check-not-exn and check-exn for contracts — e.g., something like typecheck-passes and typecheck-fails:

#lang typed/racket
(require typed/rackunit)

(: proc (CustomFooType . -> . CustomFooType))
(define (proc a) a)

(typecheck-passes (proc custom-foo-value)) ;; returns silence
(typecheck-fails (proc not-a-foo-value)) ;; also returns silence

I appreciate that typed/rackunit operates at runtime and typechecking happens at compile-time. OTOH I don’t see why in principle the check itself couldn't happen at compile-time, so long as it has the ability to a) detect success or failure and b) suppress failure (i.e., stop an error from bubbling up the chain of handlers).

wrong object when returning dotted terms?

This unit test will fail (it's not currently in the test suite):

[tc-e/t (lambda: ([x : One])
          (let ([f (plambda: (a ...) [w : a ... a] w)])
            (f x "hello" #\c)))
        (t:-> -One (-lst* -One -String -Char))]

with error message:

Typed Racket Tests > Unit Tests > Typechecker tests > tc-expr tests > 1112 
(lambda: ([x : One])
  (let ([f (plambda: (a ...) [w : a ... a] w)])
    (f x "hello" #\c)))
FAILURE
location:   <pkgs>/typed-racket-test/unit-tests/typecheck-tests.rkt:1112:8
actual:     (tc-results
 (list
  (tc-result
   (-> One (List One String Char) : (Top | Bot) ((0 0)))
   (Top | Bot)
   -))
 #f)
expected:   (tc-results
 (list (tc-result (-> One (List One String Char)) (Top | Bot) -))
 #f)
tc-expr did not return the expected value. It returned a more precise value. The types don't match.
--------------------

So, object of this function is incorrect. It should be empty, but is instead the first argument of the function.

Type inference in `let` bindings appears to be broken

I present the following code sample:

#lang typed/racket/base

(define-type ABC (U 'a 'b 'c))

(define-struct ABCWrapper ([abc : ABC]))

(: abc-123-define (ABCWrapper -> (U 1 2 3)))
(define (abc-123-define wrapper)
  (define abc (ABCWrapper-abc wrapper))
  (cond
    [(eq? abc 'a) 1]
    [(eq? abc 'b) 2]
    [(eq? abc 'c) 3]))

(: abc-123-let (ABCWrapper -> (U 1 2 3)))
(define (abc-123-let wrapper)
  (let ([abc (ABCWrapper-abc wrapper)])
    (cond
      [(eq? abc 'a) 1]
      [(eq? abc 'b) 2]
      [(eq? abc 'c) 3])))

The typechecker gives an error about abc-123-let, but not abc-123-define. If I add an explicit type annotation to the let binding ([abc : ABC ...]), then it typechecks properly.

This is new behavior, and it doesn't occur in Racket v6.1.1. I encountered it while trying to build whalesong, which depends on proper type inference in this instance.

improvements for specified filter proving desired

The below code should typecheck. I'll get around to it sometime soon...

lang typed/racket

(struct (F) Apple ([flavor : F]))

(define-type WaApple (Apple 'Amazing))
(define-type NWFood (U WaApple 'SmokedSalmon))

(: ShouldIEatThis? (NWFood -> Boolean : WaApple))
(define (ShouldIEatThis? f)
(Apple? f))

Contract generation regression for case-> types

This example now fails to compile:

#lang typed/racket

(require/typed racket/base
               [values (case-> (Symbol -> Nothing)
                               (Symbol Boolean -> Nothing))])

The error message it produces:

match*: no matching clause for (list (arr (-> Symbol Nothing)) (arr (-> Symbol Boolean Nothing)))
  context...:
   /home/asumu/plt/racket-git/racket/collects/racket/match/runtime.rkt:22:0: match:error
   /home/asumu/plt/racket-git/extra-pkgs/typed-racket/typed-racket-lib/typed-racket/private/type-contract.rkt:299:4: loop
   /home/asumu/plt/racket-git/extra-pkgs/typed-racket/typed-racket-lib/typed-racket/private/type-contract.rkt:244:2
   /home/asumu/plt/racket-git/extra-pkgs/typed-racket/typed-racket-lib/typed-racket/private/type-contract.rkt:71:0: generate-contract-def
   /home/asumu/plt/racket-git/extra-pkgs/typed-racket/typed-racket-lib/typed-racket/private/type-contract.rkt:158:0: change-contract-fixups
   /home/asumu/plt/racket-git/extra-pkgs/typed-racket/typed-racket-lib/typed-racket/core.rkt:30:10
   /home/asumu/plt/racket-git/extra-pkgs/typed-racket/typed-racket-lib/typed-racket/typed-racket.rkt:18:4

optimizer misses flonum opportunities in `(apply + ...)` and `foldl`

The optimizer will use unsafe-fl+ for direct uses of + with flonums. Very nice. Even better, it even works variadically (which unsafe-fl+ ordinarily does not).

But when you change to (apply + ...) or foldl, you lose the optimization:

#lang typed/racket
(require math)

(+ 1.0 2.0) ; optimized
(+ 1.0 2.0 3.0) ; optimized
(apply + '(1.0 2.0 3.0)) ; not optimized
(foldl + 0.0 '(1.0 2.0 3.0)) ; not optimized
(foldl fl+ 0.0 '(1.0 2.0 3.0)) ; not optimized

The lower three lines could be better expanded to either

(unsafe-fl+ (unsafe-fl+ 1.0 2.0) 3.0)

or

(foldl unsafe-fl+ 0.0 '(1.0 2.0 3.0))

Though I think the apply form is the worthiest one to optimize, because it’s the more common idiom, and would subsume the foldl versions.

Adding types to untyped values contracted with case-> via a type environment causes function application to fail

This simple program fails:

#lang racket

(module untyped racket
  (provide
   (contract-out
    [f (case-> (-> number? number? number?))]))
  (define (f x y)
    (expt x y)))

(module type-env typed-racket/base-env/extra-env-lang
  (require (submod ".." untyped))
  (type-environment
   [f (-> -Number -Number -Number)]))

(module typed typed/racket
  (require (submod ".." type-env))
  (f 2 4))

It generates the following error message, which I've been unable to comprehend.

Type Checker: could not apply function;
 wrong number of arguments provided
  expected: 2
  given: 1 in: (#%plain-app provide/contract-id-f (quote 4))

I ran into this bug when attempting to use typed/pict, which provides functions that have case-> contracts. For example, the following fails to compile:

#lang typed/racket
(require typed/pict)

(scale (circle 20) 2)

TR: non-method functions in class bodies fail to typecheck

Originally submitted on: Wed Dec 31 14:36:01 -0500 2014
The error message is

Type Checker: type mismatch
  expected: (-> Real Real)
  given: (-> Any Any) in: bar

with `bar` highlighted in (define (bar x) x).

A workaround is to use define/private, and then replace every higher-order instance of bar in the class body with (λ ([x : Real]) (bar x)).

Steps to Reproduce:
#lang typed/racket

(require typed/racket/class)

(define foo%
  (class object%
    (super-new)

    (: bar (-> Real Real))
    (define (bar x) x)))
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 891256928
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14911.

Type annotations are ignored for functions with optional arguments, no keyword arguments, and a rest argument

Reported by Matthew Butterick on the users mailing list.

The following code typechecks, and the arguments are all given the type Any.

(: f1 ([] [String] #:rest Symbol . ->* . Any))
(define (f1 [bool #t] . syms)
 bool
 syms)

This also occurs if the type annotation is explicitly wrapped around a lambda expression.

(define f1
  (ann
   (λ ([bool #f] . syms) 
     bool
     syms)
   ([] [String] #:rest Symbol . ->* . Any)))

The type annotation appears to be completely ignored, but this bug does not occur with functions which include keyword arguments.

typed scheme: bad error on require/opaque-type

Originally submitted on: Mon Aug 11 14:32:02 -0400 2008
(module a typed-scheme
  (require/opaque-type b lwT lw?)
  (require/typed x lwT 'b)

yields 

. lw?: invalid module-path form in: lw?
> 

AND 

(require/opaque-type 'b lwT lw?)

yields 

Language: Module custom; memory limit: 256 megabytes.
. require/opaque-type: bad syntax in: (require/opaque-type (quote b) lwT lw?)
> 

The context is 

#lang scheme/load 

(module b scheme
  (require "../iswim/iswim.ss"
           "../types/types.ss")
  (require redex)
  (require texpict/mrpict scheme/class)

  (define x (to-lw (f ,a)))
  (provide lw?)
  (provide x))

(module a typed-scheme
  (require/opaque-type 'b lwT lw?)
  (require/typed x lwT 'b)

  (define-type-alias Pict Number)

  (define-struct: l: ([e : (U Symbol String (Listof l:) Pict)] 
                      [line : Integer]
                      [line-span : Integer]
                      [column : Integer]
                      [column-span : Integer]
                      [unq? : Boolean]
                      [metafunction-name : (U #f Symbol)]))
  (define: (copy (lw : lwI)) : l:
    (cond
      [(symbol? lw) lw]
      [(string? lw) 0]))

  )
Release:
4.0.2.6-svn4aug2008
Environment:
macosx "Darwin europe.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT
 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386" (i386-macosx/3m) (get-display-depth) =
 32
Human Language: english
(current-memory-use) 117288888

Collections:
(("/Users/matthias/Unison/collects/" ".DS_Store" "date" "finance" "info-domain" "info.ss"
 "short" "testing" "tll-collects" "utils" "web") ("/Users/matthias/Library/PLT
 Scheme/4.0.2.6/collects" non-existent-path) ("/Users/matthias/plt/collects" ".DS_Store"
 ".svn" "afm" "algol60" "big" "browser" "combinator-parser" "compiler" "config" "defaults"
 "doc" "drscheme" "dynext" "embedded-gui" "eopl" "errortrace" "ffi" "file" "framework"
 "frtime" "games" "graphics" "gui-debugger" "guibuilder" "handin-client" "handin-server"
 "help" "hierlist" "honu" "honu-module" "htdch" "htdp" "html" "icons" "info-domain" "lang"
 "launcher" "lazy" "little-helper" "macro-debugger" "make" "mred" "mrflow" "mrlib"
 "mysterx" "mzcom" "mzlib" "mzscheme" "mztake" "net" "openssl" "parser-tools" "planet"
 "plot" "preprocessor" "profj" "profjBoxes" "profjWizard" "r5rs" "r6rs" "readline" "redex"
 "repos-time-stamp" "rnrs" "s-exp" "scheme" "scribble" "scribblings" "setup" "sgl"
 "sirmail" "skipper" "slatex" "slibinit"!
  "slideshow" "srfi" "srpersist" "stepper" "string-constants" "swindle" "syntax"
 "syntax-color" "teachpack" "test-box-recovery" "test-engine" "test-suite" "tests"
 "tex2page" "texpict" "trace" "typed-scheme" "version" "waterworld" "web-server" "wxme"
 "xml"))
Computer Language: (("Module") (#(#t constructor mixed-fraction-e #f #t debug) (default)
 #() "#lang scheme\n"))
This bug was converted from Gnats bug 9678.

`reverse` could infer more from `List*` types with homogeneous elements

Obviously reverse can’t fully compute the output type of a variable-length list with heterogeneous elements. But with a variable-length list of homogeneous elements, the length of the output type can be inferred to be the same as the input type.

In the first two examples below, that use List, reverse correctly preserves the list length in the output type. But with List*, it weakens the type from a two-or-more list to an any-length list.

(define-type ExactlyTwoIntegers (List Integer Integer))
(define exactly-two : ExactlyTwoIntegers '(1 2))
(mb-reverse exactly-two) ; type = ExactlyTwoIntegers

(define-type OneIntOneBool (List Integer Boolean))
(define int-bool : OneIntOneBool '(1 #t))
(mb-reverse int-bool) ; type = (List Boolean Integer)

(define-type AtLeastTwoIntegers (List* Integer Integer (Listof Integer)))
(define at-least-two : AtLeastTwoIntegers '(1 2))
(reverse at-least-two) ; type = (Listof Integer)
;; but it could be (List* Integer Integer (Listof Integer))

typed scheme: incomprehensible type checking error

Originally submitted on: Mon Aug 11 14:32:01 -0400 2008
#lang scheme/load 

(module b scheme
  (require "../iswim/iswim.ss"
           "../types/types.ss")
  (require redex)
  (require texpict/mrpict scheme/class)

  (define x (to-lw (f ,a)))
  (provide lw?)
  (provide x))

(module a typed-scheme
  (require/opaque-type lwT lw? 'b)
  (require/typed x lwT 'b)

  (define-type-alias Pict Number)

  (define-struct: l: ([e : (U Symbol String (Listof l:) Pict)] 
                      [line : Integer]
                      [line-span : Integer]
                      [column : Integer]
                      [column-span : Integer]
                      [unq? : Boolean]
                      [metafunction-name : (U #f Symbol)]))
  (define: (copy (lw : lwT)) : l:
    (cond
      [(symbol? lw) lw]
      [(string? lw) 0]))

  )
Steps to Reproduce:
Full context: 

#lang scheme/load 

(module b scheme
  (require "../iswim/iswim.ss"
           "../types/types.ss")
  (require redex)
  (require texpict/mrpict scheme/class)

  (define x (to-lw (f ,a)))
  (provide lw?)
  (provide x))

(module a typed-scheme
  (require/opaque-type lwT lw? 'b)
  (require/typed x lwT 'b)

  (define-type-alias Pict Number)

  (define-struct: l: ([e : (U Symbol String (Listof l:) Pict)] 
                      [line : Integer]
                      [line-span : Integer]
                      [column : Integer]
                      [column-span : Integer]
                      [unq? : Boolean]
                      [metafunction-name : (U #f Symbol)]))
  (define: (copy (lw : lwT)) : l:
    (cond
      [(symbol? lw) lw]
      [(string? lw) 0]))

  )
Release:
4.0.2.6-svn4aug2008
Environment:
macosx "Darwin europe.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT
 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386" (i386-macosx/3m) (get-display-depth) =
 32
Human Language: english
(current-memory-use) 161397544

Collections:
(("/Users/matthias/Unison/collects/" ".DS_Store" "date" "finance" "info-domain" "info.ss"
 "short" "testing" "tll-collects" "utils" "web") ("/Users/matthias/Library/PLT
 Scheme/4.0.2.6/collects" non-existent-path) ("/Users/matthias/plt/collects" ".DS_Store"
 ".svn" "afm" "algol60" "big" "browser" "combinator-parser" "compiler" "config" "defaults"
 "doc" "drscheme" "dynext" "embedded-gui" "eopl" "errortrace" "ffi" "file" "framework"
 "frtime" "games" "graphics" "gui-debugger" "guibuilder" "handin-client" "handin-server"
 "help" "hierlist" "honu" "honu-module" "htdch" "htdp" "html" "icons" "info-domain" "lang"
 "launcher" "lazy" "little-helper" "macro-debugger" "make" "mred" "mrflow" "mrlib"
 "mysterx" "mzcom" "mzlib" "mzscheme" "mztake" "net" "openssl" "parser-tools" "planet"
 "plot" "preprocessor" "profj" "profjBoxes" "profjWizard" "r5rs" "r6rs" "readline" "redex"
 "repos-time-stamp" "rnrs" "s-exp" "scheme" "scribble" "scribblings" "setup" "sgl"
 "sirmail" "skipper" "slatex" "slibinit"!
  "slideshow" "srfi" "srpersist" "stepper" "string-constants" "swindle" "syntax"
 "syntax-color" "teachpack" "test-box-recovery" "test-engine" "test-suite" "tests"
 "tex2page" "texpict" "trace" "typed-scheme" "version" "waterworld" "web-server" "wxme"
 "xml"))
Computer Language: (("Module") (#(#t constructor mixed-fraction-e #f #t debug) (default)
 #() "#lang scheme\n"))
This bug was converted from Gnats bug 9677.

Subtyping involving functions with keyword arguments causes TR to make unsound assumptions about argument types

For some reason, this typechecks.

(: f (Number [#:y Boolean] -> Number))
(define (f x #:y [y #f] #:z [z 'this-can-be-anything])
  (if y "y is truthy" x))

To be clear, this doesn't typecheck if the z argument is removed, and it doesn't typecheck if the default for y is non-false. However, in this case, TR decides that y will always be false for some reason and lets it slide.

This isn't actually a soundness problem in this example if the optimizer is turned on. Instead, it just makes the function always return x, no matter what y is.

> (f 0 #:y #t)
- : Number
0

However, if you disable the optimizer, the soundness problem manifests, as expected.

> (f 0 #:y #t)
- : Number
"y is truthy"

strange errors in typed scheme program for multi-arity functions

Originally submitted on: Fri Aug 08 19:56:01 -0400 2008
put the program in a window 
don't save 
run the program
!!! it type checks just fine !!!
evaluate (f 10) at the prompt in the repl 
this high-lights "ng Pic" in the third line 
and reports three errors, none of them explainig what went wrong 

(Is this the bug that we are not fixing for 4.1?)
Steps to Reproduce:
#lang typed-scheme

(define-type-alias Pict Number)

(define-struct: lw ([e : (U (Listof lw) Symbol String Pict)] 
                    [line : Integer] [line-span : Integer]
                    [column : Integer] [column-span : Integer]
                    [unq? : Boolean]
                    [metafunction-name :(U #f Symbol)]))


(: f (U (Integer -> Integer) (Boolean Integer -> Integer)))
;; the U shold be a case-lambda 

(define f 
  (case-lambda: 
    [((i : Integer)) i]
    [((b : Boolean) (i : Integer)) i]))
Release:
4.0.2.6-svn4aug2008
Environment:
macosx "Darwin europe.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT
 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386" (i386-macosx/3m) (get-display-depth) =
 32
Human Language: english
(current-memory-use) 158718820

Collections:
(("/Users/matthias/Unison/collects/" ".DS_Store" "date" "finance" "info-domain" "info.ss"
 "short" "testing" "tll-collects" "utils" "web") ("/Users/matthias/Library/PLT
 Scheme/4.0.2.6/collects" non-existent-path) ("/Users/matthias/plt/collects" ".DS_Store"
 ".svn" "afm" "algol60" "big" "browser" "combinator-parser" "compiler" "config" "defaults"
 "doc" "drscheme" "dynext" "embedded-gui" "eopl" "errortrace" "ffi" "file" "framework"
 "frtime" "games" "graphics" "gui-debugger" "guibuilder" "handin-client" "handin-server"
 "help" "hierlist" "honu" "honu-module" "htdch" "htdp" "html" "icons" "info-domain" "lang"
 "launcher" "lazy" "little-helper" "macro-debugger" "make" "mred" "mrflow" "mrlib"
 "mysterx" "mzcom" "mzlib" "mzscheme" "mztake" "net" "openssl" "parser-tools" "planet"
 "plot" "preprocessor" "profj" "profjBoxes" "profjWizard" "r5rs" "r6rs" "readline" "redex"
 "repos-time-stamp" "rnrs" "s-exp" "scheme" "scribble" "scribblings" "setup" "sgl"
 "sirmail" "skipper" "slatex" "slibinit"!
  "slideshow" "srfi" "srpersist" "stepper" "string-constants" "swindle" "syntax"
 "syntax-color" "teachpack" "test-box-recovery" "test-engine" "test-suite" "tests"
 "tex2page" "texpict" "trace" "typed-scheme" "version" "waterworld" "web-server" "wxme"
 "xml"))
Computer Language: (("Module") (#(#t write mixed-fraction-e #f #t debug) (default) #()
 "#lang scheme\n"))
This bug was converted from Gnats bug 9672.

TR: casting makes type checking unsound for mutable boxes/vectors/structs

Originally submitted on: Fri Jan 30 21:20:01 -0500 2015

I'm not familiar with this problem. Let me guess the right fix: when we cast (Boxof A) to (Boxof B), should we wrap around it a contract ensuring anything going into the box as type A, (in addition to ensuring anything going out of the box has type B, which TR already does)?

Steps to Reproduce:

The following 3 expressions all produce "hi" typechecked as Integer:

(begin
  (define b1 : (Boxof Integer) (box 42))
  (define b2 (cast b1 (Boxof String)))
  (set-box! b2 "hi")
  (unbox b1))

(begin
  (define v1 : (Vectorof Integer) (vector 42))
  (define v2 (cast v1 (Vectorof String)))
  (vector-set! v2 0 "hi")
  (vector-ref v1 0))

(begin
  (struct (X) s ([i : X]) #:mutable)
  (define s1 : (s Integer) (s 42))
  (define s2 (cast s1 (s String)))
  (set-s-i! s2 "hi")
  (s-i s1))
Release:
6.1.1.7--2015-01-17(2b8acb3/a)
Environment:
unix "Linux ubuthink 3.16.0-28-generic #38-Ubuntu SMP Fri Dec 12 17:37:40 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 333255660
raco pkg (show):
Installation-wide:
 Package            Checksum     Source
 main-distribution  b660f028...  catalog main-distribution
 racket-lib         e93899ff...  catalog racket-lib
 [185 auto-installed packages not shown]
User-specific for installation "snapshot":
 Package        Checksum              Source
 rmacs          4bef6487...           catalog...acs/master
 soft-contract                        link...soft-contract
 [1 auto-installed package not shown]



Collections:
("/home/pcn/.racket/snapshot/collects"
 (non-existent-path))
("/home/pcn/bin/Racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "rackunit" "raco" "reader"
 "realm" "s-exp" "scheme" "setup" "srfi" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 debug) (default) #() "#lang racket\n" #t #t ((test) (main)) #t))
This bug was converted from Gnats bug 14955.

TR: Can't apply `make-brush`

Originally submitted on: Mon Jan 12 20:28:01 -0500 2015

In reproduction steps, I get two errors highlighting the call to make-brush:

Type Checker: could not apply function;
 wrong number of arguments provided
  expected: 10
  given: 12 in: (make-brush #:color (make-color 0 0 0) #:style (quote solid))

Type Checker: type mismatch
expected: (U False
(Vector
(Vector Real Real Real Real Real Real)
Real
Real
Real
Real
Real))
given: 'solid in: (make-brush #:color (make-color 0 0 0) #:style (quote solid))

Stranger, both (:print-type make-brush) and (:print-type make-brush*) print exactly the same thing.

Steps to Reproduce:
#lang typed/racket

(require typed/racket/draw)

(: make-brush*
   (-> [#:color (U String (Instance Color%))]
       [#:style Brush-Style]
       [#:gradient (U #f
                      (Instance Linear-Gradient%)
                      (Instance Radial-Gradient%))]
       [#:transformation (U #f (Vector (Vector Real Real Real
                                               Real Real Real)
                                       Real Real Real Real Real))]
       [#:immutable? Any]
       (Instance Brush%)))
(define make-brush* make-brush)

(make-brush* #:color (make-color 0 0 0) #:style 'solid)  ; typechecks
(make-brush #:color (make-color 0 0 0) #:style 'solid)   ; fails
Release:
6.1.1.6--2015-01-03(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 444000424
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 images-lib              e04b9058...        clone...mages-lib
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 math-lib                fd3d8168...        clone...=math-lib
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      77f8eda5...        catalog.../master
 pict3d                                     link...eil/pict3d
 plot                    220b2799...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  8f08b243...        catalog...master/
 slideshow-latex         7da8bc7a...        catalog.../master
 typed-racket-more       4f05adcd...        clone...cket-more
 unstable-flonum-lib     7071d9a3...        clone...lonum-lib
 [211 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 debug) (default) #() "#lang racket\n" #t #t ((test) (main)) #t))
This bug was converted from Gnats bug 14931.

TR: (define-values (x ...) (send ...)) fails with strange error

Originally submitted on: Tue Dec 30 17:48:01 -0500 2014

The error is

let-values: expected the identifier `#%plain-app' in: let-values
Steps to Reproduce:
#lang typed/racket

(require typed/racket/class)

(define-type Foo%
  (Class [bars (-> (Values Real Real))]))

(: foo% Foo%)
(define foo%
  (class object%
    (super-new)
    (define/public (bars) (values 0 0))))

(define floo%
  (class object%
    (init-field [foo : (Instance Foo%)])
    (super-new)
    (define-values (x y) (send foo bars))))
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 629004136
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14908.

Typechecking on mutually recursive types is buggy when used in a union with Symbol

Note: This bug is so strange that it's rather difficult to even reproduce. I'll try and describe exactly what circumstances allow me to reproduce it.

Take the following trivial program. Call it bug.rkt.

#lang typed/racket/base

(define-type Bson-Document (HashTable Symbol Bson-Value))
(define-type Bson-Value (U Bson-Document Symbol))

(define (make-document) : Bson-Value
  (define log-data : Bson-Document (make-immutable-hasheq `()))
  log-data)

For me, if I run raco setup, then running racket bug.rkt typechecks just fine, as it should! However, now I run the following command:

raco setup -c --pkgs typed-racket-more

This shouldn't have any affect on any program, much less this one, which uses absolutely zero functionality from typed-racket-more. Nevertheless, now if I run racket bug.rkt, I get the following type error:

/tmp/bug.rkt:8:2: Type Checker: type mismatch
  expected: Bson-Value
  given: Bson-Document
  in: log-data
  context...:
   /Applications/Racket v6.1.1.8/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:284:0: type-check
   /Applications/Racket v6.1.1.8/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:494:0: tc-module
   /Applications/Racket v6.1.1.8/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /Applications/Racket v6.1.1.8/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
   standard-module-name-resolver

Don't worry, it gets weirder. I now tried modifying the definition for Bson-Value. I changed it to (U Bson-Document String)—anything that didn't include Symbol worked. Then I ran racket bug.rkt again. No error!

Okay... now I changed Bson-Value back to (U Bson-Document Symbol). This time, though, I reversed the order of the type type declarations, so lines 3 and 4 looked like this:

(define-type Bson-Value (U Bson-Document Symbol))
(define-type Bson-Document (HashTable Symbol Bson-Value))

Again, no error! Wat. Now utterly confused, I ran raco setup --pkgs typed-racket-lib. Then I ran racket bug.rkt, unchanged since I swapped the lines. Guess what? Type error!

I then went back to the original code I posted at the top of this issue and ran it, but this time, it typechecked fine. I'm so hopelessly confused.


What the hell is going on? I don't know. Here's how I've managed to reproduce this bug.

  1. I've attempted this on a nice, clean Ubuntu 14.04 VM. I've installed 64-bit Racket from the utah.edu snapshots page.
  2. I've run raco setup followed by raco setup -c --pkgs typed-racket-more.
  3. I've run the originally posted bug.rkt.

Those steps give me an error. As for all the other bizarre oddities... I have no idea. Try it for yourself. Let me know what you find. I'm baffled.

TR: ps-setup% lacks types

Originally submitted on: Sat Dec 27 20:04:01 -0500 2014
The following types seem to work:

#lang typed/racket/base

(require typed/racket/class)

(provide PS-Setup%
         ps-setup%
         current-ps-setup)

(define-type PS-Setup%
  (Class (init)
         [copy-from (-> (Instance PS-Setup%) Any Void)]
         [get-command (-> String)]
         [get-editor-margin (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
         [get-file (-> (U Path-String #f))]
         [get-level-2 (-> Boolean)]
         [get-margin (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
         [get-mode (-> (U 'preview 'file 'printer))]
         [get-orientation (-> (U 'portrait 'landscape))]
         [get-paper-name (-> String)]
         [get-preview-command (-> String)]
         [get-scaling (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
         [get-translation (-> (Boxof Nonnegative-Real) (Boxof Nonnegative-Real) Void)]
         [set-command (-> String Void)]
         [set-editor-margin (-> Natural Natural Void)]
         [set-file (-> (U Path-String #f) Void)]
         [set-level-2 (-> Any Void)]
         [set-margin (-> Nonnegative-Real Nonnegative-Real Void)]
         [set-mode (-> (U 'preview 'file 'printer) Void)]
         [set-orientation (-> (U 'portrait 'landscape) Void)]
         [set-paper-name (-> String Void)]
         [set-preview-command (-> String Void)]
         [set-scaling (-> Nonnegative-Real Nonnegative-Real Void)]
         [set-translation (-> Real Real Void)]))

(require/typed
 racket/draw
 [ps-setup%  PS-Setup%]
 [current-ps-setup  (Parameterof (Instance PS-Setup%))])
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 688438260
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: Saved 1 internal error:

sequence-contract-violation: negative: method set-max-width cannot be called, except in
 states (unlocked write-lock), args 1221
  context...:
   /home/neil/plt-fresh/racket/collects/racket/private/more-scheme.rkt:147:2:
 call-with-break-parameterization
   /home/neil/plt-fresh/racket/collects/racket/private/more-scheme.rkt:264:2:
 call-with-exception-handler

Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14902.

TR: classes can't use `case-lambda` to define methods

Originally submitted on: Sat Dec 27 23:12:01 -0500 2014
Steps to Reproduce:
#lang typed/racket

(define-type Foo%
  (Class [foo (case-> (-> String Void)
                      (-> Symbol Integer Void))]))

(: foo% Foo%)
(define foo%
  (class object%
    (super-new)

    (define/public foo
      (case-lambda
        [(str)  (void)]
        [(sym size)  (void)]))))
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 1753295312
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: Saved 1 internal error:

sequence-contract-violation: negative: method set-max-width cannot be called, except in
 states (unlocked write-lock), args 1221
  context...:
   /home/neil/plt-fresh/racket/collects/racket/private/more-scheme.rkt:147:2:
 call-with-break-parameterization
   /home/neil/plt-fresh/racket/collects/racket/private/more-scheme.rkt:264:2:
 call-with-exception-handler

Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14904.

Filter issue in TR with (values)

Originally submitted on: Sat Jan 31 17:40:01 -0500 2015

Both of these should type check, but only f does.

/Users/endobson/tmp/tmp.rkt:13:4: Type Checker: type mismatch
expected: String
given: (U False String)
in: foo
context...:
/Users/endobson/proj/racket/plt/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:275:0: type-check
/Users/endobson/proj/racket/plt/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:415:0: tc-module
/Users/endobson/proj/racket/plt/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
/Users/endobson/proj/racket/plt/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
/Users/endobson/proj/racket/plt/racket/collects/compiler/cm.rkt:322:0: compile-zo*
/Users/endobson/proj/racket/plt/racket/collects/compiler/cm.rkt:534:26
/Users/endobson/proj/racket/plt/racket/collects/compiler/cm.rkt:526:42
/Users/endobson/proj/racket/plt/racket/collects/compiler/cm.rkt:491:0: maybe-compile-zo
/Users/endobson/proj/racket/plt/racket/collects/compiler/cm.rkt:606:2: do-check
/Users/endobson/proj/racket/plt/racket/collects/compiler/cm.rkt:686:4
/Users/endobson/proj/racket/plt/racket/share/pkgs/compiler-lib/compiler/commands/make.rkt:81:8: for-loop
/Users/endobson/proj/racket/plt/racket/share/pkgs/compiler-lib/compiler/commands/make.rkt: [running body]
/Users/endobson/proj/racket/plt/racket/collects/raco/raco.rkt: [running body]
/Users/endobson/proj/racket/plt/racket/collects/raco/main.rkt: [running body

Steps to Reproduce:
#lang typed/racket/base


(: f ((Option String) -> String))
(define (f foo)
  (let-values ([(v) (unless foo (error 'buggy))])
    foo))

(: g ((Option String) -> String))
(define (g foo)
  (let-values ([() (begin (unless foo (error 'buggy)) (values))])
    foo))
Release:
HEAD
Environment:
MacIntel / Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like
 Gecko) Chrome/41.0.2251.0 Safari/537.36
This bug was converted from Gnats bug 14958.

Generated contracts for polymorphic vector types need to use impersonator contracts, not chaperone contracts

This program fails with a contract error:

#lang typed/racket

(require/typed
 racket/base
 [vector-ref (All [a] (Vectorof a) Integer -> a)])

(vector-ref (vector 1 2 3) 1)
vector-ref: non-chaperone result;
 received a result that is not a chaperone of the original result
  original: 2
  received: #<a4>

I think the generated contract that wraps the vector value needs to be an impersonator contract, not a chaperone contract.

TR: can't import GUI types without instantiating racket/gui/base

Originally submitted on: Sat Jan 03 23:48:01 -0500 2015

Run the program in reproduction steps from the command line.

This makes it impossible to write the functions plot and plot3d in Typed Racket in a way that allows the documentation to build.

Steps to Reproduce:
#lang racket/base

;; Run this from the command line!

(require racket/sandbox)

(call-with-trusted-sandbox-configuration
 (lambda ()
   (define (make-eval)
     (define eval (make-evaluator 'racket/base))
     (eval '(require (only-in typed/racket/gui Snip% Frame%)))
     eval)

   (make-eval)
   (make-eval)))
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 1369750584
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 debug) (default) #() "#lang racket\n" #t #t ((test) (main)) #t))
This bug was converted from Gnats bug 14923.

typed/rackunit: check-eq? broke its contract

check-eq? and check-equal? etc get blamed when I try to compare structs.

#lang typed/racket/base

(require typed/rackunit)

(define-struct foo ([bar : Any]))
(define foo1 (make-foo 42))

(check-eq? foo1 foo1)

The error:

check-eq?: broke its contract
  Attempted to use a higher-order value passed as `Any` in untyped code: #<foo>
  in: the 1st argument of
      (->* (Any Any) (any/c) any/c)
  contract from: (interface for check-eq?)
  blaming: (interface for check-eq?)
   (assuming the contract is correct)
  at: <pkgs>/typed-racket-more/typed/rackunit/main.rkt:18.2

Consider thunking id argument to `make-make-redirect`

This may make TR module loading slightly faster, but might increase zo size.

Basic idea is change (define-syntax local-untyped-id (#,mk-redirect-id (quote-syntax untyped-id))) to (define-syntax local-untyped-id (#,mk-redirect-id (lambda () (quote-syntax untyped-id)))) and adjust "redirect-contract.rkt"

Suggested by @mflatt.

TR: untyped struct's parent can't be a typed struct

Originally submitted on: Wed Dec 31 22:44:01 -0500 2014

The error is

.../racket/collects/racket/contract/private/blame.rkt:143:0: struct:foo: contract violation
  Attempted to use a struct type reflectively in untyped code: #<struct-type:foo>
  in: "struct-type/c"
  contract from: (anonymous-module typed-defs)
  blaming: (anonymous-module untyped-defs)
   (assuming the contract is correct)
  at: unsaved-editor:5.10

This can make it difficult to convert a library to Typed Racket one piece at a time.

Steps to Reproduce:
#lang racket

(module typed-defs typed/racket
  (provide (all-defined-out))
  (struct foo () #:transparent))

(module untyped-defs racket
  (require racket/contract
           (submod ".." typed-defs))
  (provide (contract-out
            (struct bar ())))
  (struct bar foo () #:transparent))

(require 'untyped-defs)
(bar)
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 749009788
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14913.

TR: local type inference fails in class bodies, and type error identifies the wrong expression

Originally submitted on: Tue Dec 30 18:04:01 -0500 2014

The error is

Type Checker: missing type for identifier;
consider adding a type annotation with `:'
identifier: self52876 in: dc

The highlighted expression is dc in (define alpha (send dc get-alpha)), which is very confusing.

Uncommenting (: alpha Nonnegative-Real) allows the program to typecheck. But this information is already known: replacing the type declaration with (: alpha String) results in the following error message:

Type Checker: type mismatch
expected: String
given: Nonnegative-Real in: alpha

Steps to Reproduce:
#lang typed/racket

(require typed/racket/draw
         typed/racket/class)

(define foo%
  (class object%
    (init-field [dc : (Instance DC<%>)])
    (super-new)
    ;(: alpha Nonnegative-Real)
    (define alpha (send dc get-alpha))))
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 633168392
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14909.

since 6.1.1, `require/typed` seems to have lost its ability to import partial class interfaces

Comparing behavior of 6.1.1 build vs. git build from yesterday, require/typed is no longer allowing partial import of class interfaces. (IMO showstopper bug for existing code)

For instance, in 6.1.1, this code works without error:

#lang typed/racket
(require/typed racket/draw [record-dc%  (Class (init-field))])
(define dc (new record-dc%))

But in the current git build, it now throws an error:

record-dc%: broke its contract;
 method glyph-exists? not specified in contract
  in: g5
  contract from: (interface for record-dc%)
  blaming: (interface for record-dc%)
   (assuming the contract is correct)

If I add glyph-exists? to the require/typed spec, then I get a new error asking for another class method. And so forth. I confess I did not get to the end of the list to find out if require/typed would cooperate.

TR: `for` forms generalize types of sequences

Originally submitted on: Sat Dec 27 22:44:01 -0500 2014

The error in reproduction steps is

Type Checker: type mismatch
expected: Nonnegative-Real
given: Real in: r

Either of these works around it:

(for ([r : Nonnegative-Real  (ann '(1 2 3 4) (Sequenceof Nonnegative-Real))])
  (ann r Nonnegative-Real))

(for ([r  (in-list (ann '(1 2 3 4) (Listof Nonnegative-Real)))])
  (ann r Nonnegative-Real))
Steps to Reproduce:
#lang typed/racket

(for ([r  (ann '(1 2 3 4) (Sequenceof Nonnegative-Real))])
  (ann r Nonnegative-Real))
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 1319035472
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: Saved 1 internal error:

sequence-contract-violation: negative: method set-max-width cannot be called, except in
 states (unlocked write-lock), args 1221
  context...:
   /home/neil/plt-fresh/racket/collects/racket/private/more-scheme.rkt:147:2:
 call-with-break-parameterization
   /home/neil/plt-fresh/racket/collects/racket/private/more-scheme.rkt:264:2:
 call-with-exception-handler

Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14903.

Typed Racket pretends mutable sets don't exist, and yet it assumes all hashtables could be mutable

Typed Racket only provides types for immutable set operations. It would be painless to add types for mutable operations as well, but TR also considers Setof types to be covariant, which obviously isn't true with mutable sets.

This is inconsistent with how TR handles hashtables. In an ideal world, I'd like HashTable to be immutable and have a separate MutableHashTable for mutable hash tables and mutable operations. This would be nice for a number of reasons:

  • This would let hashtables be covariant.
  • This would make contracts on immutable hashtables flat contracts, so predicate generation and occurrence typing would work with them.
  • Mutability would need to be explicitly noted in the type system.

I'd unfortunately guess that this is not possible to change at this point. Still, the behavior with sets and hashtables are inconsistent. If we can't change HashTable, can we make MutableHashTable and ImmutableHashTable subtypes? Then could we make the equivalent variations for sets?

typed/rackunit: cannot define-simple-check

This innocent-looking program triggers 53 type errors.

#lang typed/racket/base

(require typed/rackunit)

(define-simple-check (check-foo? a b)
  #t)

Here they are. . .

define-simple-check.rkt:1:0: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: current-check-around
  from module: check.rkt
  in: #%module-begin
  context...:
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-with-check-info*
  from module: check-info.rkt
  in: provide/contract-id-with-check-info*
  context...:
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-name
  from module: check-info.rkt
  in: provide/contract-id-make-check-name
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-location
  from module: check-info.rkt
  in: provide/contract-id-make-check-location
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-expression
  from module: check-info.rkt
  in: provide/contract-id-make-check-expression
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-params
  from module: check-info.rkt
  in: provide/contract-id-make-check-params
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-message
  from module: check-info.rkt
  in: provide/contract-id-make-check-message
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-test-log!
  from module: rackunit/log
  in: provide/contract-id-test-log!
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: current-check-around
  from module: check.rkt
  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-with-check-info*
  from module: check-info.rkt
  in: provide/contract-id-with-check-info*
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-name
  from module: check-info.rkt
  in: provide/contract-id-make-check-name
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-location
  from module: check-info.rkt
  in: provide/contract-id-make-check-location
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-expression
  from module: check-info.rkt
  in: provide/contract-id-make-check-expression
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-params
  from module: check-info.rkt
  in: provide/contract-id-make-check-params
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-message
  from module: check-info.rkt
  in: provide/contract-id-make-check-message
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-test-log!
  from module: rackunit/log
  in: provide/contract-id-test-log!
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: current-check-around
  from module: check.rkt
  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-with-check-info*
  from module: check-info.rkt
  in: provide/contract-id-with-check-info*
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-name
  from module: check-info.rkt
  in: provide/contract-id-make-check-name
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-location
  from module: check-info.rkt
  in: provide/contract-id-make-check-location
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-expression
  from module: check-info.rkt
  in: provide/contract-id-make-check-expression
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-params
  from module: check-info.rkt
  in: provide/contract-id-make-check-params
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-message
  from module: check-info.rkt
  in: provide/contract-id-make-check-message
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-test-log!
  from module: rackunit/log
  in: provide/contract-id-test-log!
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: current-check-around
  from module: check.rkt
  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-with-check-info*
  from module: check-info.rkt
  in: provide/contract-id-with-check-info*
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-name
  from module: check-info.rkt
  in: provide/contract-id-make-check-name
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-location
  from module: check-info.rkt
  in: provide/contract-id-make-check-location
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-expression
  from module: check-info.rkt
  in: provide/contract-id-make-check-expression
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-params
  from module: check-info.rkt
  in: provide/contract-id-make-check-params
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-message
  from module: check-info.rkt
  in: provide/contract-id-make-check-message
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-test-log!
  from module: rackunit/log
  in: provide/contract-id-test-log!
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: current-check-around
  from module: check.rkt
  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-with-check-info*
  from module: check-info.rkt
  in: provide/contract-id-with-check-info*
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-name
  from module: check-info.rkt
  in: provide/contract-id-make-check-name
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-location
  from module: check-info.rkt
  in: provide/contract-id-make-check-location
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-expression
  from module: check-info.rkt
  in: provide/contract-id-make-check-expression
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-params
  from module: check-info.rkt
  in: provide/contract-id-make-check-params
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-message
  from module: check-info.rkt
  in: provide/contract-id-make-check-message
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-test-log!
  from module: rackunit/log
  in: provide/contract-id-test-log!
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: current-check-around
  from module: check.rkt
  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-with-check-info*
  from module: check-info.rkt
  in: provide/contract-id-with-check-info*
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-name
  from module: check-info.rkt
  in: provide/contract-id-make-check-name
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-location
  from module: check-info.rkt
  in: provide/contract-id-make-check-location
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-expression
  from module: check-info.rkt
  in: provide/contract-id-make-check-expression
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-make-check-params
  from module: check-info.rkt
  in: provide/contract-id-make-check-params
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: provide/contract-id-test-log!
  from module: rackunit/log
  in: provide/contract-id-test-log!
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: Polymorphic function `car' could not be applied to arguments:
Domains: (Listof a)
         (Pairof a b)
Arguments: Any

  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: Polymorphic function `cdr' could not be applied to arguments:
Domains: (Listof a)
         (Pairof a b)
Arguments: Any

  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: Polymorphic function `car' could not be applied to arguments:
Domains: (Listof a)
         (Pairof a b)
Arguments: Any

  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: No function domains matched in function application:
Domains: Any Any Any Any Any Any False False
         Any Any Any Any Any Any Any True
         Any Any False False Any Any Any Any
         Any Any Any True Any Any Any Any
         False False Any Any Any Any Any Any
         Any True Any Any Any Any Any Any
Arguments: Void False Void False Any Any Any Any

  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: make-optional-keyword-procedure
  from module: kw.rkt
  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
define-simple-check.rkt:1:0: Type Checker: type mismatch
  expected: Real
  given: Any
  in: #%module-begin
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:132:12: for-loop
   f44
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4
Type Checker: Summary: 53 errors encountered
  context...:
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:285:0: type-check
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typecheck/tc-toplevel.rkt:506:0: tc-module
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/tc-setup.rkt:39:0: tc-setup
   /home/ben/code/racket/fork/racket/share/pkgs/typed-racket-lib/typed-racket/typed-racket.rkt:18:4

TR should provide a Dictionary type

It would be nice if TR provided a built-in Dictionary type. At its simplest, it would just be (U (HashTable a b) (Listof (Pairof a b)), but vectors are also technically dictionaries.

Does TR's type system allow "specializations" of types? I.e. some way to define a special case for (Dictionary Integer b) that includes vectors?

Technically, dictionaries also include structures that implement gen:dict, but obviously generics don't exist in TR yet.

occurrence typing fails on Listof vs List

Originally submitted on: Thu Jan 22 14:20:01 -0500 2015

Occurrence typing fails on the [Listof (U A B)] vs [List (U A B)]. See program below.

Logically this makes no sense because if cadr and friends succeed, the type can be split.

Steps to Reproduce:
#lang typed/racket

(define-type Line String)

(: line-specification? (-> String (U False [Listof Line])))
(define (line-specification? line)
  (: r (U False [Pairof String [Listof (U False String)]]))
  (define r '("a" "b") #;(regexp-match #px"--* (.*)" line))
  (cond
    [(and r) (if (cadr r) (string-split (cadr r)) #f)]
    [else '()]))
Release:
6.1.1.8--2015-01-03(-/f)
Environment:
macosx "Darwin antarctica.ccs.neu.edu 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29
 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64" (x86_64-macosx/3m)
 (get-display-depth) = 32
Human Language: english
(current-memory-use) 913381128
raco pkg (show):
Installation-wide:
 Package                 Checksum     Source
 ansi                    2770248a...  catalog ansi
 github://github.com/tonyg/racket-ansi/master
 benchmark               45992763...  catalog benchmark
 git://github.com/stamourv/racket-benchmark#master
 graph                   9528fd5f...  catalog graph
 github://github.com/stchang/graph/master
 honu                    6a982c11...  catalog honu git://github.com/racket/honu
 htdp                    76ca9ca3...  clone /Users/matthias/plt/extra-pkgs/htdp/htdp
 git://github.com/racket/htdp/?path=htdp
 main-distribution       67868e03...  catalog main-distribution
 git://github.com/racket/main-distribution
 main-distribution-test  ca4a870e...  catalog main-distribution-test
 git://github.com/racket/main-distribution-test
 marketplace             e48aabc2...  catalog marketplace
 github://github.com/tonyg/marketplace/typeless
 racket-lib                           static-link /Users/matthias/plt/pkgs/racket-lib
 rackunit                466a679c...  clone
 /Users/matthias/plt/extra-pkgs/rackunit/rackunit
 git://github.com/racket/rackunit/?path=rackunit
 [217 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/Users/matthias/0Unison/collects/"
 (".DS_Store" "compiled" "date" "finance" "info-domain" "info.ss" "pdf.ss~" "session"
 "short" "testing" "tll-collects" "utils" "web"))
("/Users/matthias/Library/Racket/development/collects"
 (non-existent-path))
("/Users/matthias/plt/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 debug) (default) #() "#lang racket" #t #t ((test) (main)) #t))
This bug was converted from Gnats bug 14947.

TR: class methods can't have keyword arguments

Originally submitted on: Wed Dec 31 14:32:01 -0500 2014
The error message is

Type Checker: missing type for identifier;
 consider using `require/typed' to import it
  identifier: find-method/who
  from module: racket/private/class-internal in: (send foo bar #:up? #t)

with the last line of the program in reproduction steps highlighted.
Steps to Reproduce:
#lang typed/racket

(require typed/racket/class)

(define foo%
  (class object%
    (super-new)

    (: bar (->* [] [#:up? Boolean] Void))
    (define/private (bar #:up? [up? #f]) (void))))

(define foo (new foo%))
(send foo bar #:up? #t)
Release:
6.1.1.6--2014-12-21(-/f)
Environment:
unix "Linux snoopy 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 2868307060
raco pkg (show):
Installation-wide:
 Package                 Checksum           Source
 disassemble             cf0ee3a5...        catalog...ssemble
 drbayes                                    link...il/drbayes
 main-distribution       67868e03...        catalog...ibution
 main-distribution-test  ca4a870e...        catalog...on-test
 nonplussed              f6c06999...        url.../nonplussed
 optimization-coach      be5f7908...        catalog...n-coach
 pict3d                                     link...eil/pict3d
 plot                    e536986e...        clone...path=plot
 racket-lib                                 static-link...lib
 rsound                  4f5d4d15...        catalog rsound
 slideshow-latex         9275fecb...        catalog...w-latex
 [214 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/home/neil/.racket/development/collects"
 (non-existent-path))
("/home/neil/plt-fresh/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 none) (default) #() "#lang racket\n" #t #f ((test) (main)) #t))
This bug was converted from Gnats bug 14910.

internal TC error "Tried to move vars to dbound that already exists"

#lang typed/racket

(: f (-> One (List One String Char) : #:object (0 0)))
(define (f [x : One])
  (let ([f (plambda: (a ...) [w : a ... a] w)])
    (f x "hello" #\c)))

throws an internal error:

Welcome to DrRacket, version 6.2.0.2--2015-04-02(9481e39/a) [3m].
Language: typed/racket; memory limit: 128 MB.

../../Applications/Racket v6.2.0.2/share/pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt:263:0: Internal Typechecker Error: Tried to move vars to dbound that already exists
while typechecking:
(#%app f x (quote hello) (quote c))
originally:
(f x hello c)

occurrence typing fails in strange ways for when/unless

Originally submitted on: Thu Jan 22 17:40:01 -0500 2015
#lang typed/racket

(: f (-> (U False [Listof String]) [Listof String]))
(define (f l)
  (unless l
    (error 'f ""))
  (define &^%$ l) ;; comment this line out and it type-checks 
  l)
Release:
6.1.1.8--2015-01-03(-/f)
Environment:
macosx "Darwin antarctica.ccs.neu.edu 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29
 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64" (x86_64-macosx/3m)
 (get-display-depth) = 32
Human Language: english
(current-memory-use) 840257332
raco pkg (show):
Installation-wide:
 Package                 Checksum     Source
 ansi                    2770248a...  catalog ansi
 github://github.com/tonyg/racket-ansi/master
 benchmark               45992763...  catalog benchmark
 git://github.com/stamourv/racket-benchmark#master
 graph                   9528fd5f...  catalog graph
 github://github.com/stchang/graph/master
 honu                    6a982c11...  catalog honu git://github.com/racket/honu
 htdp                    76ca9ca3...  clone /Users/matthias/plt/extra-pkgs/htdp/htdp
 git://github.com/racket/htdp/?path=htdp
 main-distribution       67868e03...  catalog main-distribution
 git://github.com/racket/main-distribution
 main-distribution-test  ca4a870e...  catalog main-distribution-test
 git://github.com/racket/main-distribution-test
 marketplace             e48aabc2...  catalog marketplace
 github://github.com/tonyg/marketplace/typeless
 racket-lib                           static-link /Users/matthias/plt/pkgs/racket-lib
 rackunit                466a679c...  clone
 /Users/matthias/plt/extra-pkgs/rackunit/rackunit
 git://github.com/racket/rackunit/?path=rackunit
 [217 auto-installed packages not shown]
User-specific for installation "development":
 [none]



Collections:
("/Users/matthias/0Unison/collects/"
 (".DS_Store" "compiled" "date" "finance" "info-domain" "info.ss" "pdf.ss~" "session"
 "short" "testing" "tll-collects" "utils" "web"))
("/Users/matthias/Library/Racket/development/collects"
 (non-existent-path))
("/Users/matthias/plt/racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "raco" "reader" "realm" "s-exp"
 "setup" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 debug) (default) #() "#lang racket" #t #t ((test) (main)) #t))
This bug was converted from Gnats bug 14948.

The `list` special case uses the expected type poorly

Example:

#lang typed/racket

(: x (U (List Symbol Any)
        (List String Symbol)))
(define x (list "foo" 'bold))

Produces this error message:

/tmp/union.rkt:5:10: Type Checker: type mismatch
  expected: (U (List Symbol Any) (List String Symbol))
  given: (List String Any)
  in: (list "foo" (quote bold))
  context...:

Note that using a literal list there for x will work.

Handling of positive and negative floating-point zeroes is broken and unsound

This lovely piece of work typechecks.

(: f (Nonnegative-Flonum -> Nonnegative-Flonum))
(define (f x) x)

(f -0.0)

This is a problem. Specifically, it makes stuff like this go screwy:

(expt (real->single-flonum -0.0) -1)

The type of that expression is expected to be a Nonnegative-Flonum. It isn't. It's -inf.0.

Considering Flonum-Zero a subtype of Nonnegative-Flonum and Nonpositive-Flonum is an error, but changing that would likely break things. How can this be fixed?

Return type annotations on named-let forms aren't considered within the body unless all bindings are explicitly annotated

This fails to typecheck if it is run at the top-level (within a module):

(let loop : Integer ([n 10])
  (cond
    [(= n 5) n]
    [else (loop (sub1 n))]))

The return type of loop is considered to be AnyValues within the loop body (inferred from the surrounding context), ignoring the annotation. However, if n is explicitly annotated, for some reason it typechecks:

(let loop : Integer ([n : Integer 10])
  (cond
    [(= n 5) n]
    [else (loop (sub1 n))]))

TR: internal error with specific pattern matching of struct from other module

Originally submitted on: Tue Dec 30 14:32:01 -0500 2014

TR reveals Internal Typechecker Error when pattern matching against a struct defined in another module.

This problem seems very recent and was not present in e21f75f.

Steps to Reproduce:

File "lib.rkt":

#lang typed/racket/base
(provide (all-defined-out))
(struct s ([x : Any]) #:transparent)

File "main.rkt":

#lang typed/racket/base
(require racket/match "lib.rkt")

(: f : Any → Any)
(define (f x)
  (match x
    [(list (s (and n 'x 'y)) c) 'impossible]))

Typechecking "main.rkt" gives error:

; Internal Typechecker Error: no type for unsafe-car7 at: #f line #f col #f
; while typechecking:
; here
; originally:
; here
; Context:
; /home/pcn/bin/Racket/collects/syntax/parse/private/residual.rkt:141:0 check/force-syntax-list^depth
; /home/pcn/bin/Racket/collects/syntax/parse/private/residual.rkt:141:0 check/force-syntax-list^depth

Release:
6.1.1.6--2014-12-29(94a4509/a)
Environment:
unix "Linux ubuthink 3.16.0-28-generic #38-Ubuntu SMP Fri Dec 12 17:37:40 UTC 2014 x86_64
 x86_64 x86_64 GNU/Linux" (x86_64-linux/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 323305940
raco pkg (show):
Installation-wide:
 Package            Checksum     Source
 main-distribution  faa4af00...  catalog main-distribution
 racket-lib         0ab2c828...  catalog racket-lib
 [185 auto-installed packages not shown]
User-specific for installation "snapshot":
 Package        Checksum  Source
 soft-contract            link /home/pcn/Code/soft-contract



Collections:
("/home/pcn/.racket/snapshot/collects"
 (non-existent-path))
("/home/pcn/bin/Racket/collects"
 (".gitignore" "acks" "compiler" "data" "db" "dynext" "ffi" "file" "info" "info-domain"
 "json" "launcher" "net" "openssl" "pkg" "planet" "racket" "rackunit" "raco" "reader"
 "realm" "s-exp" "scheme" "setup" "srfi" "syntax" "unstable" "version" "xml"))

Recent Internal Errors: 
Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t
 debug) (default) #() "#lang racket\n" #t #t ((test) (main)) #t))
This bug was converted from Gnats bug 14907.

return type for `memf` too generous?

> memf
- : (All (a) (-> (-> a Any) (Listof a) (U False (Listof a))))

This return type allows Empty as a possible result, because Empty is a subtype of every Listof .... Right?

But if memf isn’t False, then it returns a positive-length list tail. Right?

If so, perhaps there’s no need to permit Empty, and memf could use a tighter type that reflects this, e.g.:

- : (All (a) (-> (-> a Any) (Listof a) (U False (List* a (Listof a))))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.