Skip to content

a failure in type inference for bindings in let-loop #1038

@capfredf

Description

@capfredf

What version of Racket are you using?

8.0.0.3 on 0ff8d18be50b44c7595c909706068a241020e372

What program did you run?

(define (func [a : Fixnum]) : Fixnum
  a)

(let loop ([idx (ann 10 Fixnum)])
  (func idx))

What should have happened?

The program should've type checked

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

Type Checker: type mismatch
  expected: Fixnum
  given: Integer
  in: idx

If we use a simple let-binding, the code would typecheck:

(let ([idx (ann 10 Fixnum)])
  (func idx))

This is one of the underlying issues that the following code (as a commented testcase in #953) doesn't type check

(for/list : (Listof Fixnum) ([i (in-fxvector (fxvector 1 2 3 4) 3 -1 -2)]) i)

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

    Issue actions