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

TR fails to typecheck when using optional arg and inline type specs #1372

Open
jbclements opened this issue May 8, 2024 · 0 comments
Open

Comments

@jbclements
Copy link
Contributor

What version of Racket are you using?

8.12.900

What program did you run?

#lang typed/racket

(define (foo3 [x : Boolean] [y : Boolean #f]) : Boolean
  (if x (foo3 #f #t) #t))

What should have happened?

I claim program should type-check...

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

Type Checker: missing type for identifier;
consider adding a type annotation with `:'
identifier: foo3 in: foo3

extra info:

I suppose this is arguably a situation where following the instructions carefully solves the problem. That is, adding

(: foo3 (->* (Boolean) (Boolean) Boolean))

... to the program does allow type-checking to complete. However, this seems like a relatively unexpected failure of the type-checker, and all the more challenging because the annotation requires the use of the ->* form rather than ->.

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

No branches or pull requests

1 participant