racket / typed-racket

Typed Racket
Other
521 stars 104 forks source link

typed scheme: incomprehensible type checking error #92

Closed mfelleisen closed 9 years ago

mfelleisen commented 9 years ago
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.
samth commented 9 years ago
On Tue, 12 Aug 2008 17:46:49 -0400, samth at plt-scheme dot org wrote:
Can you include the error you're getting, so that I know exactly what to fix?

Thanks,
sam th

On Mon, Aug 11, 2008 at 2:32 PM, matthias@ccs.neu.edu wrote:

A new problem report is waiting at http://bugs.plt-scheme.org/query/?cmd=view&pr=9677 Reported by matthias for release: 4.0.2.6-svn4aug2008 *\ Description:

lang scheme/load

(require "../iswim/iswim.ss" "../types/types.ss") (require redex) (require texpict/mrpict scheme/class) (define x (to-lw (f ,a))) (provide lw?) (provide x)) (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])) ) *\ How to repeat: Full context:

lang scheme/load

(require "../iswim/iswim.ss" "../types/types.ss") (require redex) (require texpict/mrpict scheme/class) (define x (to-lw (f ,a))) (provide lw?) (provide x)) (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])) ) *\ 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"))

mfelleisen commented 9 years ago
On Tue, 12 Aug 2008 17:51:56 -0400, matthias at ccs dot neu dot edu wrote:
Something went wrong when I copied and pasted the things over.  
Doesn't it just show up when you run the program?

On Aug 12, 2008, at 5:46 PM, Sam TH wrote:

> Can you include the error you're getting, so that I know exactly  
> what to fix?
>> A new problem report is waiting at
>>  http://bugs.plt-scheme.org/query/?cmd=view&pr=9677
>> Reported by matthias for release: 4.0.2.6-svn4aug2008
>> *** Description:
>> #lang scheme/load
>>  (require "../iswim/iswim.ss"
>>           "../types/types.ss")
>>  (require redex)
>>  (require texpict/mrpict scheme/class)
>>  (define x (to-lw (f ,a)))
>>  (provide lw?)
>>  (provide x))
>>  (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]))
>>  )
>> *** How to repeat:
>> Full context:
>> #lang scheme/load
>>  (require "../iswim/iswim.ss"
>>           "../types/types.ss")
>>  (require redex)
>>  (require texpict/mrpict scheme/class)
>>  (define x (to-lw (f ,a)))
>>  (provide lw?)
>>  (provide x))
>>  (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]))
>>  )
>> *** 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"))
> -- 
> samth@ccs.neu.edu
samth commented 9 years ago
On Tue, 19 Aug 2008 15:40:56 -0400, samth
samth commented 9 years ago
On Tue, 16 Sep 2008 16:24:13 -0400, samth assigned this bug to samth

typed-scheme