Skip to content

strong_mode_invalid_method_override gets confused with complex type parameters #27546

Closed
@abarth

Description

@abarth
class X {}

class A<U extends X> {}

class B {
  A foo() => null;
}

class C<T extends A> extends B {
  @override
  T foo() => null;
}

This triggers a strong_mode_invalid_method_override on the override of foo, but that seems spurious. If you remove the <U extends X>, then the error goes away.

Metadata

Metadata

Assignees

No one assigned

    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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions