Skip to content

sc optimizer fails to simplify (-> flat-recursive-contract) #628

Closed
@bennn

Description

@bennn

Similar to #625 , I just found an error in some gradually-typed versions of the zordoz benchmark.

What version of Racket are you using?

6.10.1

What program did you run?

#lang racket/base

(module t typed/racket/base
  (provide f)

  (define-type Spec
    (-> (U Spec String)))

  (: f (-> Spec))
  (define (f)
    (λ () "hello")))

(require 't)

f

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 g5))

Probable Cause

It's an issue instantiating recursive contracts, the type above makes a (recursive-contract .... #:flat). In this case it shouldn't be flat. Probably a bug with or/sc.

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