Skip to content

typed/racket/base/shallow hangs when recursive types are in a separate module #1453

@NoahStoryM

Description

@NoahStoryM

What version of Racket are you using?
v8.15 [cs]

What program did you run?

#lang typed/racket/base/shallow

(displayln 'start)

(module goto racket/base
  (provide goto label)
  (define (goto l) (l l))
  (define (label) (call/cc goto)))

(module types typed/racket/base
  (provide Goto Label)
  (define-type (Goto a) (∪ a (→ a Nothing)))
  (define-type Label (Goto Label)))

(require 'types)
(require/typed/provide 'goto
  [label (∀ (a) (→ (→ a Nothing)))]
  [goto Label])

What should have happened?

The program should print start and then terminate, similar to the following working examples:

#lang typed/racket/base/shallow

(displayln 'start)

(module goto racket/base
  (provide goto label)
  (define (goto l) (l l))
  (define (label) (call/cc goto)))

(define-type (Goto a) (∪ a (→ a Nothing)))
(define-type Label (Goto Label))

(require/typed/provide 'goto
  [label (∀ (a) (→ (→ a Nothing)))]
  [goto Label])
#lang typed/racket/base/optional

(displayln 'start)

(module goto racket/base
  (provide goto label)
  (define (goto l) (l l))
  (define (label) (call/cc goto)))

(module types typed/racket/base
  (provide Goto Label)
  (define-type (Goto a) (∪ a (→ a Nothing)))
  (define-type Label (Goto Label)))

(require 'types)
(require/typed/provide 'goto
  [label (∀ (a) (→ (→ a Nothing)))]
  [goto Label])

If you got an error message, please include it here.

No error message is displayed. The program simply hangs indefinitely after printing start.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions