Commit Graph

4770 Commits

Author SHA1 Message Date
Dan Rubel 5da015187e Improve top level method modifier recovery
This updates the fasta parser to report additional analyzer errors
and improves recovery when parsing top level method modifiers.

Change-Id: If863011f6d9a33b366d621bc708c0cc25922ddb9
Reviewed-on: https://dart-review.googlesource.com/14000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-10-16 16:06:55 +00:00
Aske Simon Christensen f1b07b2789 Error on setter having not exactly one parameter
Rewrite setter with invalid parameters into one with one parameter
and a body throwing a compile-time error.

Some analyzer tests fail until we sort out the expected form of the
generated kernel code in situations like this. This is tracked in
https://github.com/dart-lang/sdk/issues/31096

Closes https://github.com/dart-lang/sdk/issues/31069
Change-Id: I65033709813671ecb933e6a4dc00d1ff3b504661
Reviewed-on: https://dart-review.googlesource.com/13080
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2017-10-16 15:07:49 +00:00
Brian Wilkerson e8bd4c33c1 Add comments and asserts; remove unneeded expects
Change-Id: Ie5e4262f2aed248cdc71b52f1bd1e06ea1d5fc83
Reviewed-on: https://dart-review.googlesource.com/13966
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-16 12:41:27 +00:00
Paul Berry 078da9f5c0 Exchange the order of looping in _computeCovarianceFixes.
The outer loops are now through the arguments of the method to be
fixed, and the inner loops are through the inherited methods.  This
allows us to handle the situation where a forwarding stub is needed
because isGenericCovariantInterface changes from true to false, but
the forwarding stub doesn't need to be concrete, since
isGenericCovariantImpl is inherited from the base class.  (Previously
that situation didn't work because by the time we processed the
inheritance of isGenericCovariantImpl, we had already created a
concrete forwarding stub).

Additional fixes in this CL (necessary to get tests to pass in
meaningful ways):

- Updated InstrumentationValueForForwardingStub to print covariance
  annotations on type parameters.

- Updated _createForwardingStub to copy covariance annotations from
  the target procedure to the procedure being created.

- Moved call_through_this.dart from runtime_checks/ to
  runtime_checks_new/ because the analyzer implementation doesn't
  handle this case correctly.

Change-Id: I984a46826a3a4d8ad1a1ce840269498df049fef0
Reviewed-on: https://dart-review.googlesource.com/13963
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-16 04:07:18 +00:00
Brian Wilkerson d20bfc5095 Map error codes for uninitialized const and final variables
Change-Id: I55e284cce214ffc9d08d5132e7b142f0d07572e3
Reviewed-on: https://dart-review.googlesource.com/13965
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-15 20:35:07 +00:00
Paul Berry 75b28512d1 Fix logic for applying annotation fixes.
When multiple fixes need to be inserted at the same offset, they need
to be inserted in reverse order, so that they will be in the correct
order in the final file state.

Change-Id: Ifa976c7cb5548869f9f7fcfff2d89ffb2110b882
Reviewed-on: https://dart-review.googlesource.com/13962
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-15 15:32:45 +00:00
Brian Wilkerson 66e5dc35de Associate more fasta and analyzer errors
Change-Id: I9e5151fb51cd4d0e488d0dfcc614f286f5f6cadc
Reviewed-on: https://dart-review.googlesource.com/13934
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-14 19:50:57 +00:00
Konstantin Shcheglov 6b5ba5351b Implement combining outlines for top-level declarations.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: Id849e68d3026457bdddb98604b92c7424961bbd9
Reviewed-on: https://dart-review.googlesource.com/11649
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-10-13 20:32:24 +00:00
Konstantin Shcheglov df459aa19d Malbounded types should have all 'dynamic' type arguments.
See "19.8 Parameterized Types" in the specification.

"In short, any arity mismatch results in all type arguments being dropped, and
replaced with the correct number of type arguments, all set to dynamic. Of course,
a static warning will be issued."

R=ahe@google.com, paulberry@google.com, sigmund@google.com

Bug: https://github.com/dart-lang/sdk/issues/31062
Change-Id: Ia04b6c4da538582736617931eb7b7c20dc0a4259
Reviewed-on: https://dart-review.googlesource.com/13340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-10-13 18:44:34 +00:00
Brian Wilkerson 75908a5315 Fix recovery inside expressions
Change-Id: I20bc1c87c258cb99032e0d8099e88f56779fc509
Reviewed-on: https://dart-review.googlesource.com/13880
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-13 18:06:05 +00:00
Brian Wilkerson 940b9e5fdf Connect a Fasta error to an Analyzer error
Change-Id: I9b47e6712b65c2e97693bfef4c022109431660f1
Reviewed-on: https://dart-review.googlesource.com/13860
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-13 18:05:44 +00:00
Brian Wilkerson 64eee95cb0 Minor clean-up of asserts and comments
Change-Id: Ib28a6ba789bfdf65f740863c28ca050512433736
Reviewed-on: https://dart-review.googlesource.com/13820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-10-13 17:55:58 +00:00
Konstantin Shcheglov 49503ac2cc Start using Kernel metadata support in KernelDriver and Analyzer.
Use it to implement documentation comments for typedef(s).

R=ahe@google.com, paulberry@google.com, sigmund@google.com

Bug:
Change-Id: I6f67f1c0e6b6f383a96e6bf6eee17f4786bc5f99
Reviewed-on: https://dart-review.googlesource.com/12700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-10-13 17:47:53 +00:00
Brian Wilkerson 2aa005b11b Improved handling of semicolons
Change-Id: I85c42387bad18149bd2fb7718f6d40b82a95562f
Reviewed-on: https://dart-review.googlesource.com/13626
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-13 16:16:43 +00:00
danrubel 1582021556 Allow built-in keywords as top level function identifiers
Change-Id: I4287e8279d2ebe6f4460ce48409b7bd9ead16b96
Reviewed-on: https://dart-review.googlesource.com/13627
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 23:48:05 +00:00
Brian Wilkerson a22c8dc958 Recover when enum constants have metadata
Change-Id: I1432c3b2d4ce63c5520087c79dd33e48c57cee5b
Reviewed-on: https://dart-review.googlesource.com/13102
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 20:50:31 +00:00
Brian Wilkerson d13822df9b Add support for replacing tokens to TokenStreamRewriter and use it in the parser
Change-Id: Icbd809f9baf4a88abc653f4df62d8c2e0457b677
Reviewed-on: https://dart-review.googlesource.com/13240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-12 18:39:11 +00:00
danrubel 08544ff5af address comment in "Refactor and update modifier warnings"
See https://dart-review.googlesource.com/c/sdk/+/11800/1/pkg/front_end/lib/src/fasta/parser/modifier_context.dart#18

Change-Id: I3d8ba9b8bb2d67761cfd321ac5cbb30061dc099f
Reviewed-on: https://dart-review.googlesource.com/13583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 17:42:13 +00:00
Brian Wilkerson c2f11254c8 Recover from a class declaration with no body
Change-Id: Ib92d79087841d89ef4dd660345aa22e4006f59c1
Reviewed-on: https://dart-review.googlesource.com/13580
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 16:08:33 +00:00
Paul Berry 974d365e92 Get rid of ShadowProcedure._typeInferrer, since it is no longer used.
Also remove KernelProcedureBuilder.prepareTopLevelInference, whose
sole purpose was to populate it.

Change-Id: Id42e931ebe6a2b9da4f30e54fc3d33627f84a5b7
Reviewed-on: https://dart-review.googlesource.com/13581
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-12 14:55:11 +00:00
Paul Berry f29478aa4b Remove AccessorNode and related code, since it is no longer used.
Change-Id: I17bdd017c7b585e72960ff0138fd0967d73e662c
Reviewed-on: https://dart-review.googlesource.com/13304
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-12 06:25:30 +00:00
Dan Rubel 9370149f69 fix keyword as identifer edgecase
This addresses the situation where a top level built-in keyword
such as "import" or "export" is used as an identifier
in a top level declaration.

Change-Id: I663ed00502eadd2c639f79e68d26345783911faa
Reviewed-on: https://dart-review.googlesource.com/13361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 03:38:48 +00:00
Dan Rubel b00f57f9e6 refactor isKeywordOrIdentifier(token) to token.isKeywordOrIdentifier
Change-Id: Iefe1bb58f738649e8f420d543c33dcc9ec1eceb9
Reviewed-on: https://dart-review.googlesource.com/13360
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 02:35:31 +00:00
Paul Berry 89a9768a3c Use proxy objects to represent synthetic accessors.
Previously, we created genuine kernel objects to represent the
synthetic setters and getters associated with fields.  This led to
problems, because a given field would have multiple synthetic setters
and getters associated with it, and those synthetic getters and
setters would fall out of sync with each other during type inference
and covariance propagation.

This CL changes the kernel objects representing synthetic setters and
getters so that they are proxy objects; they inherit most of their
functionality from the corresponding kernel representation, but they
override the properties having to do with types and covariance so that
they refer to the underlying field.  This ensures that nothing gets
out of sync, since the field is the single source of truth about its
type and covariance.

Change-Id: Iff44c408e84ef34df337c81e7bfbd125d61020d8
Reviewed-on: https://dart-review.googlesource.com/13281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-12 01:34:11 +00:00
Paul Berry b2c128e44d Drop pointers to InferenceNode objects as quickly as possible.
This should help reduce GC overhead.

Change-Id: I171aa1a24e4691d80a818d6ef3b11db0b3e3da84
Reviewed-on: https://dart-review.googlesource.com/13320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-12 00:24:31 +00:00
Dan Rubel 1c7c72c679 Refactor and update modifier warnings
* Extract parse modifiers
    into ModifierContext and ModifierRecoveryContext
* Recover gracefully given out-of-order modifiers
* Generate analyzer error codes
* Address comment in prior CL
    https://dart-review.googlesource.com/c/sdk/+/10760/1/pkg/front_end/lib/src/fasta/parser/parser.dart#436

There are several more modifier error codes that need to be added.
I will tackle those in a subsequent CL.

Change-Id: I61e9182e14fa9d45b35029013a645329e6cc54ab
Reviewed-on: https://dart-review.googlesource.com/11800
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-11 23:32:10 +00:00
Paul Berry 494d78efd5 Transition to new top level type inference logic.
With this CL, we stop creating the old AccessorNode objects and start
creating the inference nodes associated with the new ForwardingNode
infrastructure.  This fully integrates top level type inference with
forwarding stub generation.

There is a small difference between the behavior of the old and new
type inference infrastructure: in the old infrastructure, when
inferring the type of a getter or setter, we would consider both
inherited getters and inherited setters.  Now, we follow the spec.
This introduces some minor differences from analyzer functionality, so
the tests of this functionality are moved into the "inference_new"
directory.

Change-Id: Ie17df9abf1a3ab99e7d22683ffdf6d1b13ec86be
Reviewed-on: https://dart-review.googlesource.com/13180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 21:32:10 +00:00
Paul Berry 7df0fb6c28 Add type propagation support for conditional expressions.
This required adding a few extra parser events to allow the type
propagator to update its state when the `?` and `:` are encountered
(similar to what was done for `if`).

Fixes #30620.

Change-Id: I0d3ede8056fd8bab01ead5b242d00803286c9373
Reviewed-on: https://dart-review.googlesource.com/13182
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 20:21:22 +00:00
Brian Wilkerson 1e48c3f4d1 Recover from having an index operator with no expression
Change-Id: Ic4a6abcc95f61da047053398804bfe947565de88
Reviewed-on: https://dart-review.googlesource.com/11680
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-11 18:00:30 +00:00
Paul Berry 8a18f73b2b Make an InferenceNode class for inferring getter/setter types.
Change-Id: I423dfa42cf5e355c2b6c525c628016e0f6013838
Reviewed-on: https://dart-review.googlesource.com/13060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 17:23:50 +00:00
Paul Berry df9889787c Propagate type inference out of logical expressions.
This addresses some of the failures reported in #30620.

Change-Id: I4a528a2d45ef5df814063b433dcf8a664cce4097
Reviewed-on: https://dart-review.googlesource.com/13000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 17:04:17 +00:00
Paul Berry 6408d5ac05 Eliminate ForwardingNode._setter boolean.
It was redundand with the "kind" field, inherited from Procedure.

Change-Id: I166e75a60222e5d501d3662d82be1648bb7f88d5
Reviewed-on: https://dart-review.googlesource.com/12881
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-11 16:39:30 +00:00
Brian Wilkerson e942115fcd Fix an infinite loop in the parser
Change-Id: I0946867082afecde10afb00abedc94bb0f18f6d3
Reviewed-on: https://dart-review.googlesource.com/12040
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-10-11 15:40:30 +00:00
Paul Berry a2495da7f5 Change AccessorNode pointers to InferenceNode pointers.
This will pave the way for using other kinds of InferenceNodes for type inference.

Change-Id: If0b3b9467fade267d7741f134e0de67484ad9df0
Reviewed-on: https://dart-review.googlesource.com/12920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 15:02:11 +00:00
Paul Berry b474f5e754 Process getters and setters together when creating forwarding nodes.
This will be necessary when we try to integrate type inference with
the creation of forwarding nodes, because getter types can be inferred
from inherited setters and vice versa.

We accomplish this by producing two separate lists (getters and
setters), then merging them together.  This results in a list where
correspondingly-named getters and setters are grouped together, with
getters appearing before setters.

Change-Id: I549f0b4354370753a6aa7a15285d778980fb4841
Reviewed-on: https://dart-review.googlesource.com/12900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 14:35:41 +00:00
Paul Berry 4c507af684 Create an implementation of InferenceNode to infer a field type from its initializer.
Change-Id: Ib96734b3ef3a448a106b12ea4d874397bd2d903e
Reviewed-on: https://dart-review.googlesource.com/12842
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 00:25:36 +00:00
Paul Berry 650816fd26 Trigger top level type inference resolution by member lookup.
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>
2017-10-10 23:55:36 +00:00
Paul Berry aa99974ec8 Create an implementation of InferenceNode for method inference.
Change-Id: I591d5637216a08cff2e764a05fc3501d3f3432e6
Reviewed-on: https://dart-review.googlesource.com/12822
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-10 23:19:16 +00:00
Paul Berry 5f37d7a7d4 Move inference of setter return types outside the other type inference logic.
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>
2017-10-10 23:03:52 +00:00
Paul Berry feccb794a2 Don't attempt to query the setter type of a non-setter.
Fixes #31031.

Change-Id: I1a82f7a3da31ad89d0303232977a64ddd546898c
Reviewed-on: https://dart-review.googlesource.com/12781
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-10 21:39:14 +00:00
Paul Berry 0ab8dba6fb Create a base class InferenceNode to be used by all type inference logic.
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>
2017-10-10 21:00:52 +00:00
Paul Berry fff1bff0a8 Remove unused classes DependencyCollector and DependencyCollectorImpl.
Change-Id: Ie77f7f9e7e7374daae0d028a4b095bff0c1bf155
Reviewed-on: https://dart-review.googlesource.com/12720
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-10 19:10:13 +00:00
Paul Berry 9545cf6e2f Check for SyntheticAccessor in _requiresTypeInference.
This will be necessary once we start doing type inference on fields in
InterfaceResolver.

Change-Id: If363ba4d2b3b42efd3fa7975a94e29286882d5ab
Reviewed-on: https://dart-review.googlesource.com/12620
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-10 16:03:16 +00:00
Paul Berry 655d3ce665 Account for forwarding nodes when looking up inherited members in InterfaceResolver.
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>
2017-10-10 15:55:14 +00:00
Aske Simon Christensen 2f9d4efff6 Produce error statement for return with value from generator
Introduces a handleInvalidStatement method in listeners to signal
that the previous statement was invalid.

Closes https://github.com/dart-lang/sdk/issues/29983
Change-Id: I08d69062aa626a554b88d11d2c8c0e31b0abbe28
Reviewed-on: https://dart-review.googlesource.com/11501
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-10 08:34:21 +00:00
Paul Berry 8d02be26db Override fileOffset and fileUri in SyntheticAccessor.
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>
2017-10-10 04:56:41 +00:00
Paul Berry 8455c13e75 Rework access to ShadowClass._inferenceInfo.
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>
2017-10-10 04:52:41 +00:00
Paul Berry 9799028747 Resolve inherited accessors before computing forwarding stubs.
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>
2017-10-10 03:45:47 +00:00
Paul Berry c33b17d9ae Store _isImplicitlyTyped in ShadowField.
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>
2017-10-10 01:43:18 +00:00
Paul Berry 6d202e7ea6 Split finishTopLevel into two phases.
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>
2017-10-10 01:23:42 +00:00