It turns out that we don't need any special support for factory
constructors; the migration engine already knows that their return
type should be non-nullable, and it propagates that non-nullability
properly backward from return statements. So we just need to remove
the error handling logic that prevented factory constructors from
being used.
Change-Id: I7875750fd603ecb2fb65f3831a7883a2d4c9a11a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107380
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This CL addresses implicit constructors without parameters. Implicit
constructors with parameters will take a bit more work to accomplish,
and will be handled in a follow-up CL.
Change-Id: Id12725712198eeeff8e4080e8fa0ca2a1eb46177
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The new data structure, called `DecoratedClassHierarchy`, computes and
caches the variable substitutions necessary to relate a class to one
of its superclasses. In future CLs, we'll use this information to
create the appropriate contraints for override relationships, and to
compute the correct types when a method dispatch resolves to a method
declared in a superclass.
Note that the analyzer uses `InhertanceManager2` both to determine
what a method call resolves to and to record the appropriate
substitutions. We can take advantage of its determination of what a
method call resolves to (that information is stored in the resolved
AST), but we need to cmopute the substitutions separately because the
substitutions need to be decorated with nullability nodes.
Change-Id: Ifb334972e509b77151d41f7e0700cd590d7b5417
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106800
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>