Skip to content

Invalid recursive contract generated #858

Open
@camoy

Description

@camoy

What version of Racket are you using?

v7.4.0.1 with static contract optimizations disabled (this bug only manifests itself then).

What program did you run?

#lang racket

(module a typed/racket
  (define-type T (Rec T (-> (U T String))))
  (provide f)
  (: f (-> T T))
  (define (f x) x))

(require 'a)
(f (lambda () ""))

What should have happened?

No error.

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

recursive-contract: contract violation
  expected: flat-contract?
  given: (-> (or/c String g639058))

The expansion into recursive-contract includes #:flat for a non-flat argument.

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