Commit Graph

61 Commits

Author SHA1 Message Date
Paul Berry bf79e4604c Migration: Add support for synthetic constructors in generic class type aliases.
Change-Id: I8eee88e4dd607623fe109143d01438a5271b3230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-27 19:34:05 +00:00
Paul Berry c1c24c2e19 Migration: Enable support for factory constructors.
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>
2019-06-26 18:18:46 +00:00
Paul Berry 0db6f216ba Migration: add void type support to DecoratedType.forImplicitType.
Change-Id: Ifae57627d13a4913d86ab8a4789615a23ec66c1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107441
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-26 18:04:46 +00:00
Paul Berry 9ec7b3ebea Migration: add the ability to union decorated function types.
Change-Id: Ife92ab951ee0a60edea12c0d1fe4f242135a8ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-26 16:40:36 +00:00
Paul Berry 4c75f452fa Fix a misleading variable name in node_builder_test.dart
Change-Id: If9802562c362efe8d43b30c822211de3a49cca8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-26 16:40:36 +00:00
Paul Berry 40609fc30e Migration: build decorated types for implicit constructors of class type aliases (with parameters).
Change-Id: I3ff55830e07cba115db7784998b013112d4d07b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-25 22:13:44 +00:00
Paul Berry fa5b04d718 Migration: build decorated types for implicit constructors of class type aliases (partial).
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>
2019-06-24 21:20:30 +00:00
Paul Berry 2ac79599b0 Migration: Created decorated types for synthetic default constructors of generic classes.
Fixes #37347.

Change-Id: I8eb7ca910f62aa7f10efbad3048096118cfcb4c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107185
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-24 21:20:30 +00:00
Paul Berry c4ad3c30e8 Migration: Created decorated types for synthetic default constructors of non-generic classes.
Partially addresses #37347.

I'll address generic classes in a follow-up CL.

Change-Id: I207465c897f9dfb84848d792cba15ae96c95e394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107183
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-24 20:45:04 +00:00
Paul Berry e2bc5513f0 Migration: add a data structure for tracking class hierarchy information.
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>
2019-06-21 22:42:01 +00:00
Paul Berry d622fa010b Migration: Split up migration_visitor_test.dart.
This will make it easier to re-use the test infrastructure for some
other tests I plan to introduce in a follow-up CL.

Change-Id: I0a243f00f342674fe38274eb46e7c1e943817785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106442
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-18 17:43:05 +00:00