As a preparation for evaluating instance field initializers in classes
with primary constructors, where you can reference formal parameters of
these primary constructors.
Change-Id: I8c1276ec9ae7b2f5950a1abefb7cb8492a736dfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483843
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This update computation of implicit field types to return the inferred initializer. The ensure that we only compute the initializer once, and allows us to merge two pipelines for compute the field type and initializer.
Change-Id: I6005e19cc3dec9c717e426f06d817e2d45edcff1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451480
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
evaluateConstructorCall now returns a Constant, which means evaluation may be cut early in some places if there's an error. However, some code generators rely on _InstanceCreationEvaluator to complete, and so there's no _major_ changes to the design right now (and some small additions to avoid breaking many tests).
This CL is just the framework for the "return Constant" design and will be the base for reporting better errors in constructor invocations.
These changes already show that we cut some amount of over-reporting in our existing language and unit tests, which is a step in the right direction.
Bug: https://github.com/dart-lang/sdk/issues/47603, https://github.com/dart-lang/sdk/issues/47351, https://github.com/dart-lang/sdk/issues/49389
Change-Id: I5ba7f1282658884c18a32d5e98c7804bbfeac0f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312347
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>