Skip to content

Follow-up on TyperState exception #24291

@odersky

Description

@odersky

Compiler version

3.8

Minimized example

#23609 triggered an assertion error in TyperState. The relevant explanation seems to be in ProtoTypes.scala:

            // To respect the pre-condition of `mergeConstraintWith` and keep
            // `protoTyperState` committable we must ensure that it does not
            // contain any type variable which don't already exist in the passed
            // TyperState. This is achieved by instantiating any such type
            // variable. NOTE: this does not suffice to discard type variables
            // in ancestors of `protoTyperState`, if this situation ever
            // comes up, an assertion in TyperState will trigger and this code
            // will need to be generalized.

The error was avoided by turning it into a handled exception in #23665. But that's really only a workaround. We should get to the bottom of this and prevent the exception being thrown.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions