Re: [racket-users] strange typed-racket contract error
I also get a similar error message with this: #lang racket/base (require typed/racket/base) (require/typed racket/math [pi Real]) . . ../../Applications/Racket/April-24/Racket v6.2.0.2/collects/racket/contract/private/blame.rkt:143:0: pi: broke its contract promised: #f produced: 3.141592653589793 in: #f contract from: (interface for pi) blaming: (interface for pi) (assuming the contract is correct) at: unsaved-editor:3.28 So should require/typed produce a syntax error about being used in an untyped context? On May 8, 2015, at 5:44 PM, Alexander D. Knauth wrote: > This doesn’t happen if I change the language of the submodule to > typed/racket/base, so I’m guessing this is because require/typed isn’t meant > to be used in untyped code. > > So should require/typed produce a syntax error when it’s used in untyped code > like this? > > On May 8, 2015, at 5:30 PM, Sam Tobin-Hochstadt wrote: > >> This appears to be a bug -- my guess is that the contract isn't >> actually generated, and thus turns into `#f` -- that's what >> `require/typed` expands to, before TR inserts the real contract. >> >> Sam >> >> On Fri, May 8, 2015 at 5:26 PM, Alexander D. Knauth >> wrote: >>> I have this file: >>> #lang typed/racket >>> (provide x) >>> (define x : Natural 3) >>> (module* main racket/base >>> (require typed/racket/base) >>> (require/typed (submod "..") >>>[x Natural])) >>> >>> I get this strange error message: >>> . . ../../../../../Applications/Racket/April-24/Racket >>> v6.2.0.2/collects/racket/contract/private/blame.rkt:143:0: x: broke its >>> contract >>> promised: #f >>> produced: 3 >>> in: #f >>> contract from: (interface for x) >>> blaming: (interface for x) >>> (assuming the contract is correct) >>> at: /Users/Alex/Documents/DrRacket/tr-submod-error/lib.rkt:7.18 >>> >>> What? >>> >>> I just realized I meant to use require/untyped-contract instead of >>> require/typed, but still, what? >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Racket Users" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to racket-users+unsubscr...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] strange typed-racket contract error
This doesn’t happen if I change the language of the submodule to typed/racket/base, so I’m guessing this is because require/typed isn’t meant to be used in untyped code. So should require/typed produce a syntax error when it’s used in untyped code like this? On May 8, 2015, at 5:30 PM, Sam Tobin-Hochstadt wrote: > This appears to be a bug -- my guess is that the contract isn't > actually generated, and thus turns into `#f` -- that's what > `require/typed` expands to, before TR inserts the real contract. > > Sam > > On Fri, May 8, 2015 at 5:26 PM, Alexander D. Knauth > wrote: >> I have this file: >> #lang typed/racket >> (provide x) >> (define x : Natural 3) >> (module* main racket/base >> (require typed/racket/base) >> (require/typed (submod "..") >> [x Natural])) >> >> I get this strange error message: >> . . ../../../../../Applications/Racket/April-24/Racket >> v6.2.0.2/collects/racket/contract/private/blame.rkt:143:0: x: broke its >> contract >> promised: #f >> produced: 3 >> in: #f >> contract from: (interface for x) >> blaming: (interface for x) >> (assuming the contract is correct) >> at: /Users/Alex/Documents/DrRacket/tr-submod-error/lib.rkt:7.18 >> >> What? >> >> I just realized I meant to use require/untyped-contract instead of >> require/typed, but still, what? >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to racket-users+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] strange typed-racket contract error
This appears to be a bug -- my guess is that the contract isn't actually generated, and thus turns into `#f` -- that's what `require/typed` expands to, before TR inserts the real contract. Sam On Fri, May 8, 2015 at 5:26 PM, Alexander D. Knauth wrote: > I have this file: > #lang typed/racket > (provide x) > (define x : Natural 3) > (module* main racket/base > (require typed/racket/base) > (require/typed (submod "..") > [x Natural])) > > I get this strange error message: > . . ../../../../../Applications/Racket/April-24/Racket > v6.2.0.2/collects/racket/contract/private/blame.rkt:143:0: x: broke its > contract > promised: #f > produced: 3 > in: #f > contract from: (interface for x) > blaming: (interface for x) >(assuming the contract is correct) > at: /Users/Alex/Documents/DrRacket/tr-submod-error/lib.rkt:7.18 > > What? > > I just realized I meant to use require/untyped-contract instead of > require/typed, but still, what? > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] strange typed-racket contract error
On 2015-05-08 17:26:05 -0400, Alexander D. Knauth wrote: > I get this strange error message: > . . ../../../../../Applications/Racket/April-24/Racket > v6.2.0.2/collects/racket/contract/private/blame.rkt:143:0: x: broke its > contract > promised: #f > produced: 3 > in: #f > contract from: (interface for x) > blaming: (interface for x) >(assuming the contract is correct) > at: /Users/Alex/Documents/DrRacket/tr-submod-error/lib.rkt:7.18 My guess is that the contract generation phase doesn't see that there are contracts that need to be generated in the submodule. The definitions for generated contracts default to #f. Can you submit this as a TR bug? Cheers, Asumu -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] strange typed-racket contract error
I have this file: #lang typed/racket (provide x) (define x : Natural 3) (module* main racket/base (require typed/racket/base) (require/typed (submod "..") [x Natural])) I get this strange error message: . . ../../../../../Applications/Racket/April-24/Racket v6.2.0.2/collects/racket/contract/private/blame.rkt:143:0: x: broke its contract promised: #f produced: 3 in: #f contract from: (interface for x) blaming: (interface for x) (assuming the contract is correct) at: /Users/Alex/Documents/DrRacket/tr-submod-error/lib.rkt:7.18 What? I just realized I meant to use require/untyped-contract instead of require/typed, but still, what? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.