Skip to content

language/inference/inconsistent_inheritance_test fails #42127

@scheglov

Description

@scheglov
class A {
  void f(Object x) {}
}

class B {
  void f(String x) {}
}

class C extends A implements B {
  void f(x) {
    // Infers Object for x.
    Object y = x;
    String z = x;
    //         ^
    // [analyzer] STATIC_TYPE_WARNING.INVALID_ASSIGNMENT
    // [cfe] A value of type 'Object' can't be assigned to a variable of type 'String'.
  }
}

This requires dart-lang/language#975 finished and landed.

Metadata

Metadata

Assignees

Labels

NNBDIssues related to NNBD Releaselegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions