Every time we look up a member during type level type inference, we do
so because we need the type of the looked up member. So rather than
look it up and then trigger its type to resolve, we simply resolve it
as part of the lookup.
Change-Id: I0428649fbc99966dae1c0c3a04b6c5e4f680c9ab
Reviewed-on: https://dart-review.googlesource.com/12840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
It doesn't make sense to use the full type inference machinery for
setting the return types of setters to `void`. Just do it directly in
the builder.
Change-Id: Ia20671b17b77c758519f813d40285d9795fea6ea
Reviewed-on: https://dart-review.googlesource.com/12743
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
AccessorNode is changed to inherit from InferenceNode, and the logic
for coping with circularities is moved into the base class (with some
refactoring).
Change-Id: Ie505e40f2ede344a168878759bba05aa704e0c4b
Reviewed-on: https://dart-review.googlesource.com/12740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This allows covariance information to propagate properly between
classes and avoids creation of unnecessary forwarding stubs.
Change-Id: Ib55c62adb74d16f94282e752e387634086001946
Reviewed-on: https://dart-review.googlesource.com/12600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This is necessary because we will need to consult fileOffset and
fileUri in order to make covariance annotations.
Change-Id: I989393cd3f66c0875b4e8e091c7a8d7523a08b20
Reviewed-on: https://dart-review.googlesource.com/12422
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Two changes:
- ShadowClass.getClassInferenceInfo now accepts an ordinary class, and
returns `null`. This will allow us to ensure that if a ShadowClass
gets re-used later as an ordinary Class (which sometimes happens
during incremental analysis), it will behave the same as an ordinary
Class.
- We don't create ShadowClass._inferenceInfo at the time of
ShadowClass creation; we wait until a builder is stored. This will
allow ShadowClass objects with no inference info to be easily
created in unit tests.
Change-Id: I0dd2d65b0c477b069ec36872c13b19ba8ebbd021
Reviewed-on: https://dart-review.googlesource.com/12382
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is necessary because the need for a forwarding stub may be
affected by the types of inherited accessors, and the types of
inherited accessors may need to be determined by type inference.
Change-Id: I160cf21186485d2572301f3cda8621ede517c47b
Reviewed-on: https://dart-review.googlesource.com/12400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Previously we were using the presence or absence of an AccessorNode to
determine whether the field was implicitly typed. But AccessorNode is
going to go away soon, so we need a boolean.
Change-Id: I7ef5bfb8be25f753fa674472b72d7bef0d3a2baf
Reviewed-on: https://dart-review.googlesource.com/12380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Soon, inference of instance fields will be unified with the logic for
creating forwarding stubs. When this happens, we will need the order
of inference to be:
1 Finish top level inference of static fields.
2 Finish top level inference of other fields, and create forwarding stubs.
3 Finish top level inference of initializing formals.
Currently, (1) and (3) are performed by the same method,
finishTopLevel(). Splitting it into two methods allows us to put (2)
in between.
Change-Id: I70e1a47e8ad604bdb8f0348c54d6017c0a0b57b5
Reviewed-on: https://dart-review.googlesource.com/12381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This will simplify integrating top level type inference with the
InterfaceResolver, since the instrumentation logic won't have to be
migrated.
Change-Id: I89a23888d92622549c493249fd3d98c6ee5af8da
Reviewed-on: https://dart-review.googlesource.com/12124
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Also extend the verifier so that we won't make mistakes like this
again in the future.
Change-Id: Idbdf02dabed8b8cf86cb0b8a1fc08080338b9709
Reviewed-on: https://dart-review.googlesource.com/11961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This separates compiling platform.dill files from the patch_sdk.dart
script. The motivation for that is that I'm working on reading patch
files directly from Fasta, so we can completely remove the build step
for generating patched_sdk and dart2js_patched_sdk.
Short-term this should allow Paul to add a strong-mode version of
platform.dill without causing to many conflicts with my work on
patches.
Change-Id: I1150845b2986348d4fffe27092701d8a9b57ea54
Reviewed-on: https://dart-review.googlesource.com/11506
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This allows creating strong mode TypeEnvironments without actually subclassing
it.
Make SubtypeTester.isBottom treat Null as Bottom in strong mode.
Bug:
Change-Id: Icdd1a4b736ce0fe839a6ef30cf24487111f32d25
Reviewed-on: https://dart-review.googlesource.com/11882
Reviewed-by: Paul Berry <paulberry@google.com>
We don't need to supply the dependent node every time we call
inferAccessorFused; we can just let TypeInferenceEngine keep track of
which type inference node (if any) is currently being inferred.
Change-Id: I75b222ce038ad31c196aeb9c33b315731f4f1c52
Reviewed-on: https://dart-review.googlesource.com/11700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Type inference of methods now occurs during
SourceLoader.prepareTopLevelInference. Since this method visits
classes in class hierarchy order, we no longer need special logic to
ensure that base classes are inferred before derived classes.
Change-Id: Idf9f67226005bee6986d026c255e83926b4253d6
Reviewed-on: https://dart-review.googlesource.com/11560
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This CL handles the case where a class overrides a concrete method
with an abstract one, but forwarding stub logic determines that a
concrete method is needed. In this case we don't need to create a
full forwarding stub; we just need to add an implementation to the
abstract method that already exists.
We annotate this case as `/*@forwardingStub=implementation*/`.
Change-Id: Id0b0c6f84f666161f17942d3b4d7afc115c615f5
Reviewed-on: https://dart-review.googlesource.com/11367
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
We only need to retain long-lived forwarding nodes for getters and
setters; methods and operators can be resolved immediately, since
their resolution can't depend on top level type inference of
initializers.
This should help speed up InterfaceResolver by reducing the number of
long-lived objects it leaves in the heap.
Change-Id: I05f8d5ed1c12968f4382d43ae23955171cdbfc05
Reviewed-on: https://dart-review.googlesource.com/11241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This updates the fasta parser to handle out of order clauses
in the class header similar to analyzer.
Also:
* Fix parseTopLevelDeclaration in parser test proxy
* Fix parseStuff to correctly update token stream
* Extract skipUnexpectedTokenOpt
Change-Id: Ic20c0ab1355e866aa241c591ceeada390890c46a
Reviewed-on: https://dart-review.googlesource.com/9880
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL replaces outdated VmTarget and FlutterTarget with VmFastaTarget
and FlutterFastaTarget. 'Fasta' suffix is droped from target names.
The new FlutterTarget extends VmTarget, so they share more code.
Change-Id: Id79956698a889c9a49b8a67914f1f96a731407ab
Reviewed-on: https://dart-review.googlesource.com/9423
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>