Skip to content

Add more tests for super-bounded types #2386

@sgrekhov

Description

@sgrekhov

We have no tests tor the following statement

It is a compile-time error if a parameterized type T is super-bounded when
it is used in any of the following ways:
• T is an immediate subterm of a new expression (17.13.1) or a constant
object expression (17.13.2).
• T is an immediate subterm of a redirecting factory constructor signature
(10.7.2).
• T is an immediate subterm of an extends clause of a class (10.9), or it
occurs as an element in the type list of an implements clause (10.10), or
a with clause (10).

We also have no any test checking that class C<T extends T> {} is an error

Metadata

Metadata

Assignees

Labels

type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions