Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem caused by Recursive Parameter Type #973

Closed
NoahStoryM opened this issue Sep 24, 2020 · 1 comment · Fixed by #985
Closed

A problem caused by Recursive Parameter Type #973

NoahStoryM opened this issue Sep 24, 2020 · 1 comment · Fixed by #985
Labels

Comments

@NoahStoryM
Copy link
Contributor

What version of Racket are you using?

v7.8

What program did you run?

#lang typed/racket/base
(define-type Type1 (U Number (Parameter Type1)))
(define-type Type2 (U Type1 Symbol))
(ann (ann 123 Type1) Type2)
#lang typed/racket/base
(define-type Type1 (U Number (Parameter Type2)))
(define-type Type2 (U Type1 Symbol))
(ann (ann 123 Type1) Type2)

What should have happened?

123

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

The code all failed with the following message:

Type Checker: type mismatch
  expected: Type2
  given: Type1
  in: 123
@capfredf
Copy link
Sponsor Member

capfredf commented Oct 30, 2020

This issue has nothing to do with recursive types. It is due to how TR treats a parameter type internally. I have a quick fix, but I still need to sleep on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants