Files
sdk/pkg/nnbd_migration/lib
Paul Berry f04053d767 Migration: do not union inferred types in overrides.
Previously, when handling an override such as:

  abstract class A {
    int/*?*/ f();
  }
  class C implements A {
    f() => 0;
  }

we would create a union edge between the implicit return type of C.f
and the explicit return type of A.f.  This was a problem because
nullability information can propagate bidirectionally through union
edges, so it could result in types unnecessarily becoming nullable,
e.g.:

  abstract class A {
    int/*?*/ f();
  }
  abstract class B {
    int f(); // Should not need to be made nullable
  }
  class C implements A, B {
    f() => 0;
  }

This CL fixes the problem by just making ordinary unidirectional edges
for overrides involving inferred types.

Change-Id: I63a5f1f640b5543fcf39304087592e984aa66694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141853
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-04-01 12:07:44 +00:00
..