Skip to content

Raw types in bounds should be allowed when the raw type bound is ground #28580

Closed
@leafpetersen

Description

@leafpetersen

If a parameterized type A is used somewhere in a type bound with no type arguments, it is currently treated as an error in strong mode unless the type parameter to A has no bound. This should be relaxed to also allow this in any case where the bound on the type parameter to A does not reference any other type parameters to A. Examples:

class A<T> {}

/// Already allowed, A is treated as A<dynamic>
class B<T extends A> {}

class C<T extends A<int>> {}

/// Currently disallowed, should be allowed, C is treated as C<A<int>>
class D<T extends C> {}

/// Currently disallowed, should be allowed, List<C> is treated as List<C<A<int>>
class E<T extends List<C>> {}

Metadata

Metadata

Labels

P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions