TR: untyped struct's parent can't be a typed struct
Open
@samth is already working on this.
Since Apr 9, 2015.
gnats-migrated
- Dominant language
- Racket
- Stars
- 575
- Forks
- 106
- Avg merge
- 2h 1m
- Merged PRs (30d)
- 2
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.