Skip to content

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

@jbclements

Description

@jbclements

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 ->.

Metadata

Metadata

Assignees

No one assigned

    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