Skip to content

Compiler should reject type as its own lower bound #1372

@scabug

Description

@scabug

According to SLS, 4.3 'Type Declarations and Type Aliases':

It is also an error if an abstract type is directly or indirectly its own upper or lower bound.

trait A
{
	type T[S[_]] >: T[S]
}

Actual: this code compiles successfully with 2.7.2.RC2

Expected: compile-time error

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)tcpolyusability

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions