samth / test-bugs

2 stars 0 forks source link

Filter issue in TR with (values) #183

Open endobson opened 9 years ago

endobson commented 9 years ago
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.