From c5ec933bb8f2b99d4e2c23e41cf01947773ab974 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 21 Jun 2016 15:10:24 -0400 Subject: [PATCH] Add more predefined types --- typed-racket-lib/typed-racket/env/init-envs.rkt | 7 ++----- typed-racket-lib/typed-racket/types/abbrev.rkt | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typed-racket-lib/typed-racket/env/init-envs.rkt b/typed-racket-lib/typed-racket/env/init-envs.rkt index 3bb85de4..9c6d613c 100644 --- a/typed-racket-lib/typed-racket/env/init-envs.rkt +++ b/typed-racket-lib/typed-racket/env/init-envs.rkt @@ -273,7 +273,6 @@ (list ,@(convert augments)) ,(and init-rest (type->sexp init-rest)))) class-type] - [(ClassTop:) `(make-ClassTop)] [(Instance: ty) `(make-Instance ,(type->sexp ty))] [(Signature: name extends mapping) (define (serialize-mapping m) @@ -286,7 +285,6 @@ `(make-Signature (quote-syntax ,name) ,serialized-extends (list ,@(serialize-mapping mapping)))] - [(UnitTop:) `(make-UnitTop)] [(Unit: imports exports init-depends result) `(make-Unit (list ,@(map type->sexp imports)) (list ,@(map type->sexp exports)) @@ -354,10 +352,9 @@ (define (path-elem->sexp pe) (match pe [(In-Predefined-Table: id) id] - ;; CarPE, CdrPE, SyntaxPE, ForcePE are in the table + ;; CarPE, CdrPE, SyntaxPE, ForcePE, FieldPE are in the table [(StructPE: ty idx) - `(make-StructPE ,(type->sexp ty) ,idx)] - [(FieldPE:) `(make-FieldPE)])) + `(make-StructPE ,(type->sexp ty) ,idx)])) (define (bound-in-this-module id) (let ([binding (identifier-binding id)]) diff --git a/typed-racket-lib/typed-racket/types/abbrev.rkt b/typed-racket-lib/typed-racket/types/abbrev.rkt index c98cdfcd..2ae46a39 100644 --- a/typed-racket-lib/typed-racket/types/abbrev.rkt +++ b/typed-racket-lib/typed-racket/types/abbrev.rkt @@ -198,6 +198,8 @@ (define/decl -Thread-CellTop (make-ThreadCellTop)) (define/decl -Prompt-TagTop (make-Prompt-TagTop)) (define/decl -Continuation-Mark-KeyTop (make-Continuation-Mark-KeyTop)) +(define/decl -ClassTop (make-ClassTop)) +(define/decl -UnitTop (make-UnitTop)) (define/decl -Port (Un -Output-Port -Input-Port)) (define/decl -SomeSystemPath (Un -Path -OtherSystemPath)) (define/decl -Pathlike (Un -String -Path)) @@ -251,6 +253,7 @@ (define/decl -cdr (make-CdrPE)) (define/decl -syntax-e (make-SyntaxPE)) (define/decl -force (make-ForcePE)) +(define/decl -field (make-FieldPE)) ;; Type alias names (define (-struct-name name)