Look up unrenamed versions of type aliases as well.
Fixes bug reported by Alexander Knauth.
This commit is contained in:
parent
7a67243d68
commit
a3e25231a6
|
@ -1,8 +1,9 @@
|
|||
#lang racket/base
|
||||
|
||||
(require "../utils/utils.rkt"
|
||||
syntax/id-table racket/dict
|
||||
(utils tc-utils)
|
||||
syntax/id-table racket/dict
|
||||
(utils tc-utils)
|
||||
(typecheck renamer)
|
||||
racket/match)
|
||||
|
||||
(provide register-type-alias
|
||||
|
@ -33,7 +34,8 @@
|
|||
(mapping-put! id (make-resolved ty)))
|
||||
|
||||
(define (lookup-type-alias id parse-type [k (lambda () (tc-error "Unknown type alias: ~a" (syntax-e id)))])
|
||||
(match (free-id-table-ref the-mapping id #f)
|
||||
(match (or (free-id-table-ref the-mapping id #f)
|
||||
(free-id-table-ref the-mapping (un-rename id) #f))
|
||||
[#f (k)]
|
||||
[(struct unresolved (stx #f))
|
||||
(resolve-type-alias id parse-type)]
|
||||
|
|
9
typed-racket-test/succeed/provide-alias-omit-define.rkt
Normal file
9
typed-racket-test/succeed/provide-alias-omit-define.rkt
Normal file
|
@ -0,0 +1,9 @@
|
|||
#lang racket
|
||||
(module m typed/racket
|
||||
(provide x)
|
||||
(define-type x 'x #:omit-define-syntaxes)
|
||||
(define x : x 'x))
|
||||
(module n typed/racket
|
||||
(require (submod ".." m))
|
||||
x ; works fine, outputs 'x
|
||||
(define y : x x))
|
Loading…
Reference in New Issue
Block a user