Skip to content

Class binding in the same compilation unit can't be used in type constructor #1209

@shirok

Description

@shirok

Precompiling the following code:

(define-class <foo> () ())

(define (foo x)
  (assume-type x (<?> <foo>))
  x)

raises an error:

*** ERROR: Can't use non-inlinable global variable `#<identifier #f#<foo>.e3ed6980>' in type constructor expression: (<?> <foo>)

However, if (define-class ...) is in a separate compilation unit, it works.

define-class creates an inlinable global binding. It can be that inlinability isn't handled correctly if the binding is in the transient module during compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions