Re: [racket-dev] seeing compile-time error for Whalesong on HEAD

2013-04-29 Thread Danny Yoo
Ah, ok, I've reduced the test case to something more managable: two
files, promise.rkt and test-promise.rkt, with the following content:


;; promise.rkt
#lang typed/racket/base
(require (for-syntax racket/base))
(provide MyPromise)
(define-struct: (a) MyPromise ([thunk : (-> a)])
  #:mutable)


;; test-promise.rkt
#lang racket/base
(require "promise.rkt")


The untyped code just requires the typed module, forcing the type
contract code to generate.  It looks like #:mutable is necessary here:
if I take that out of the type, then I don't see the error.
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] seeing compile-time error for Whalesong on HEAD

2013-04-29 Thread Eric Dobson
I submitted a commit on Thursday which changed the contract generation
code, to introduce the buggy behavior. So thats why there wasn't an
error until now. It should be during module compilation where the
error is raised, so that should narrow it down. I'll try to take a
look tonight if you cannot get a small testcase.

On Mon, Apr 29, 2013 at 5:16 PM, Danny Yoo  wrote:
> Yeah, I want to reduce this to a test case, but I haven't been able to
> figure out yet what part of Whalesong is tickling this one.  I'm also
> a bit confused, as this part of the code hasn't been touched in
> months, and so I would have expected the error to show up much sooner.
>  Unfortunately, I don't have time today to git bisect to find out at
> what point this got exposed.
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] seeing compile-time error for Whalesong on HEAD

2013-04-29 Thread Danny Yoo
Yeah, I want to reduce this to a test case, but I haven't been able to
figure out yet what part of Whalesong is tickling this one.  I'm also
a bit confused, as this part of the code hasn't been touched in
months, and so I would have expected the error to show up much sooner.
 Unfortunately, I don't have time today to git bisect to find out at
what point this got exposed.
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] seeing compile-time error for Whalesong on HEAD

2013-04-29 Thread Eric Dobson
LGTM, can you submit a testcase or at least a bug so that we can add a
test case for this code path?

On Mon, Apr 29, 2013 at 4:42 PM, Danny Yoo  wrote:
> I believe the right fix for this is:
>
> 
> https://github.com/dyoo/racket/commit/24d03f2bf308854deb365fe8bcf6599e8d84fab9
>
> but I do not have enough comfort with TR to know if this will break
> anything.  Can someone review this?  Thanks!
> _
>   Racket Developers list:
>   http://lists.racket-lang.org/dev
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] seeing compile-time error for Whalesong on HEAD

2013-04-29 Thread Danny Yoo
I believe the right fix for this is:


https://github.com/dyoo/racket/commit/24d03f2bf308854deb365fe8bcf6599e8d84fab9

but I do not have enough comfort with TR to know if this will break
anything.  Can someone review this?  Thanks!
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] seeing compile-time error for Whalesong on HEAD

2013-04-29 Thread Danny Yoo
There's something funky in typed-racket/private/type-contract.rkt,
with some non-uniformity in the following lines:

https://github.com/plt/racket/blob/master/collects/typed-racket/private/type-contract.rkt#L143-L149

where the keywords are being called #:kind, but the variable binding
is called "flat", and it's done inconsistently between t->c and
t->c/both, and there's a use here:

https://github.com/plt/racket/blob/master/collects/typed-racket/private/type-contract.rkt#L432

that tries to use them interchangeably, and that looks off.
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] seeing compile-time error for Whalesong on HEAD

2013-04-29 Thread Danny Yoo
I'm seeing the following error message on HEAD
(08dc0e10d934cb29b9830a94945c2e38c275a9d8):


application: procedure does not expect an argument with given keyword
  procedure: t->c/both
  given keyword: #:kind
  given arguments:
   Boolean
   #:kind 'impersonator
   #:seen (list (cons
#(struct:# (Boolean (-> g305) (U Sentinel g305))) #))
  context...:
   /Users/dyoo/local/racket/collects/racket/private/kw.rkt:1255:14
   
/Users/dyoo/local/racket/collects/typed-racket/private/type-contract.rkt:428:16:
for-loop
   parse-loop178
   /Users/dyoo/local/racket/collects/racket/private/map.rkt:21:13: map
   parse-loop1254
   
/Users/dyoo/local/racket/collects/typed-racket/private/type-contract.rkt:215:13
   /Users/dyoo/local/racket/collects/racket/private/map.rkt:21:13: map
   f902
   
/Users/dyoo/local/racket/collects/typed-racket/typecheck/provide-handling.rkt:54:2:
mk16
   /Users/dyoo/local/racket/collects/unstable/list.rkt:139:0: map/values
   
/Users/dyoo/local/racket/collects/typed-racket/typecheck/provide-handling.rkt:55:4:
mk-untyped-syntax
   
/Users/dyoo/local/racket/collects/typed-racket/typecheck/provide-handling.rkt:54:2:
mk16
   
/Users/dyoo/local/racket/collects/typed-racket/typecheck/provide-handling.rkt:143:2:
for-loop
   
/Users/dyoo/local/racket/collects/typed-racket/typecheck/provide-handling.rkt:49:0:
generate-prov
   
/Users/dyoo/local/racket/collects/typed-racket/typecheck/tc-toplevel.rkt:292:0:
type-check
   success...
_
  Racket Developers list:
  http://lists.racket-lang.org/dev