Skip to content

provided struct's name-id is automatically bound to its constructor. #1050

@NoahStoryM

Description

@NoahStoryM

What version of Racket are you using?

v8.0

What program did you run?

draft-0.rkt:

#lang typed/racket
(provide (except-out (all-defined-out) make-exp))
(struct Exp () #:constructor-name make-exp)

draft-1.rkt:

#lang typed/racket
(require "draft-0.rkt")
Exp

Run draft-1.rkt:

#<procedure:make-exp>

What should have happened?

it should raise an error like untyped version:
draft-0.rkt:

#lang racket
(provide (except-out (all-defined-out) make-exp))
(struct Exp () #:constructor-name make-exp)

draft-1.rkt:

#lang racket
(require "draft-0.rkt")
Exp

Run draft-1.rkt.

Exp: bad syntax;
 identifier for static struct-type information cannot be used as an expression
  in: Exp

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions