Skip to content

When defining a structure in REPL, its fields can't use its type. #1195

@NoahStoryM

Description

@NoahStoryM
Contributor

What version of Racket are you using?

v8.4 [cs]

What program did you run?

Welcome to Racket v8.4 [cs].
> (struct slist
    ([scar : Any]
     [scdr : SList])
    #:transparent
    #:type-name SList)
string:3:11: Type Checker: parse error in type;
 type name `SList' is unbound
  in: SList
 [,bt for context]

What should have happened?

No error.

More

We can use module to define such structure:

Welcome to Racket v8.4 [cs].
> (module typed typed/racket
    (provide (all-defined-out))
    (struct slist
      ([scar : Any]
       [scdr : SList])
      #:transparent
      #:type-name SList))
> (require 'typed)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @capfredf@NoahStoryM

        Issue actions

          When defining a structure in REPL, its fields can't use its type. · Issue #1195 · racket/typed-racket