Commit Graph

4276 Commits

Author SHA1 Message Date
Brian Wilkerson 98671b2659 Make DeclaredVariables immutable
Change-Id: I3d0233cfb4002140af7cf0166cd98466d73d630c
Reviewed-on: https://dart-review.googlesource.com/50580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-11 01:58:51 +00:00
Brian Wilkerson 8054721512 Move DeclaredVariables to a better location
Change-Id: I17190a8e888cc37cded141cbaf028691db061e49
Reviewed-on: https://dart-review.googlesource.com/50540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-10 19:25:11 +00:00
Brian Wilkerson 7764e6962e Initial API to build analysis contexts (replaces ContextLocator.locateContexts)
Change-Id: If00ce6321efb6ff4da96e654cfe2a0a8501bed95
Reviewed-on: https://dart-review.googlesource.com/50323
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-10 15:48:10 +00:00
Aske Simon Christensen bd39320b3b Recover from error on undefined continue label.
Closes https://github.com/dart-lang/sdk/issues/32800

Change-Id: Idbd11f1c17affc1e9a6dd7f4c6999464bac8982e
Reviewed-on: https://dart-review.googlesource.com/50220
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-10 14:33:11 +00:00
Konstantin Shcheglov 2471888d4a Serialize any MethodInvocation as possible const.
Bug: https://github.com/dart-lang/sdk/issues/32823
Change-Id: I0be8d25cf9d5ac16aacb693c4730ddaba3ccad5a
Reviewed-on: https://dart-review.googlesource.com/50160
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-09 18:58:06 +00:00
Brian Wilkerson 3575b810b3 Only add const in a constant context (issue 32819)
Change-Id: Ia149d812d2540fa98d76765ffb8b54fe32ecf010
Reviewed-on: https://dart-review.googlesource.com/50120
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-09 18:11:36 +00:00
Brian Wilkerson 71ffe976a9 Correctly handle constant fields when computing constness (take 2)
Change-Id: I03e78ff4a2ea18fa7362f159a07d6d035c59a4ae
Reviewed-on: https://dart-review.googlesource.com/50280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-09 16:02:26 +00:00
Dan Rubel fd87a11ad0 Update fasta parser to generate error when "throw" missing expression
Change-Id: I6610400204e111a3a6cc7971159bfdd6c2e58794
Reviewed-on: https://dart-review.googlesource.com/49880
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-06 16:10:12 +00:00
Devon Carew 7cbd0f55b5 Remove the special casing of 'packages' files from the analyzer and analysis server.
Change-Id: I11fa2f73f7cdba8c53478c9002cefe82e58c09d6
Reviewed-on: https://dart-review.googlesource.com/49822
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-06 14:57:42 +00:00
Devon Carew e448d18591 Allow empty flutter: sections in pubspec files.
Change-Id: Ibdea9fff8f20659abd7da10f0ef11b7a042e5436
Reviewed-on: https://dart-review.googlesource.com/49625
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-05 16:03:16 +00:00
Devon Carew e27b800e2a Don't emit errors for lint rule names.
Change-Id: Iafcb0cba215e07cfe5b9e30b6983dd69c2e1492b
Reviewed-on: https://dart-review.googlesource.com/49520
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-04-04 19:05:35 +00:00
Peter von der Ahé 47f09a619e Redesign LibraryPart
Before, the part-URI was serialized as a file-URI and conflated with
source location information. The part-URI is the URI in the following
declaration in a Dart source file:

   part "URI";

This is different from what we normally call a file-URI. A file URI
is used to point to the source location of the part declaration, not
the URI in the part declaration.

Furthermore, the field was serialized using writeUriReference which
only works for URIs that are in the uriToSource map on a Component.
Although this might seem like a safe optimization, it doesn't work
if the uriToSource map is omitted or if a part declaration refers to
a missing file.

Finally, due to the confusing use of fileUri, LibraryPart was
mistakenly implementing FileUriNode and annotations were stripped
of source locations if the source for the part were omitted from
uriToSource.

The partUri field is now an unresolved string that can be resolved
against either the parent library's import- or file-URI to obtain
either version as needed.

Change-Id: I255cb4eeaf89928292ab32a2f6be9ead6cc8cee1
Reviewed-on: https://dart-review.googlesource.com/49500
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-04-04 16:08:57 +00:00
Dan Rubel 701e02b2fa Update AstBuilder to handle named function declaration
Change-Id: I34e699e49b7138b6d0ecf7087afef9739888c716
Reviewed-on: https://dart-review.googlesource.com/49240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-03 20:45:19 +00:00
Dan Rubel 57d6ec265d Improve AstBuilder for-in recovery
Fix AstBuilder recovery when for-in expression is not a simple identifier

Change-Id: Id32ec4f8054de7870d8424c489dc5f5819ec7632
Reviewed-on: https://dart-review.googlesource.com/49181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-03 18:08:29 +00:00
Konstantin Shcheglov 83418436b7 Issue 32740. Support for implicit call() invocation in top-level inference.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32740
Change-Id: I669ca31653019c30a19f45f527b2bd7023ff80b0
Reviewed-on: https://dart-review.googlesource.com/49100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-03 16:04:40 +00:00
Brian Wilkerson 8d78982c3f Move file system access support from AnalysisContext to ContextRoot
Change-Id: Ic9097b8852e578001cc6555bcd4d8a94a1fde08d
Reviewed-on: https://dart-review.googlesource.com/49041
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-02 22:16:25 +00:00
Dan Rubel 1daa81339f Improve fasta parser enum declaration recovery
In addition to improving recovery when an enum declaration is missing
a body, this CL also fixes ensureBlock to report an error on the
correct token and cleans up some more analyzer tests.

Change-Id: I96e9f8380b8d92082d94fcc9fa4b8cfe113fa238
Reviewed-on: https://dart-review.googlesource.com/48980
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-02 17:55:14 +00:00
Konstantin Shcheglov feceb2c59e Restore ErrorCode default constructor, rename the one with named parameters to 'temporary'.
R=brianwilkerson@google.com

Change-Id: If0577d0e3da0abdef83f0f46f979014b69f76202
Reviewed-on: https://dart-review.googlesource.com/49020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-02 17:38:45 +00:00
Brian Wilkerson 616acb06ec Deprecate the option to enable using a URI in a part-of directive
Change-Id: Ie9df0d727c0f81c9671ccedf5ba4d21cdbbe65b8
Reviewed-on: https://dart-review.googlesource.com/48892
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-02 16:25:04 +00:00
Dan Rubel 374058aa79 Improve fasta parser try/catch error messages and recovery
Change-Id: I6e591fa5d03c73aa6f3e8060f2ca310f68be9a78
Reviewed-on: https://dart-review.googlesource.com/48709
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-01 02:14:52 +00:00
Konstantin Shcheglov 79a349fa07 Don't put libraries of all analyzed units into the current session.
This is expensive, and we rarely need this.
Requesting LibraryElement by URI costs 6-7 ms, and we need to do it
only once after a change for each library.

R=brianwilkerson@google.com

Change-Id: I7c959abdaf27e99695ffa6d451d3c516a55b7740
Reviewed-on: https://dart-review.googlesource.com/48920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-31 02:00:51 +00:00
Dmitry Stefantsov 59d859645e [fasta] Do new/const insertion in simple cases
Bug: http://dartbug.com/32553
Change-Id: I58e201ffd5019a5a65c0ac188aaab363225b5296
Reviewed-on: https://dart-review.googlesource.com/48481
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-30 18:35:05 +00:00
Jenny Messerly bed5debbeb Callable object support in Analyzer and DDC.
Fixes #32156
Fixes #32157
Fixes #32426

This also fixes `implements Function` so it has no effect in Dart 2
(it is ignored for the purposes of subtyping.)

Change-Id: Ibec9c77cd516b8b97fef68a579998598d0acf8c6
Reviewed-on: https://dart-review.googlesource.com/45141
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-03-30 18:14:55 +00:00
Konstantin Shcheglov f201ace7f3 Check for missing required libraries dart:core and dart:async.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32686
Change-Id: I337cb61911061f25b501a5615fe40c02b9749b19
Reviewed-on: https://dart-review.googlesource.com/48703
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-29 22:09:50 +00:00
Konstantin Shcheglov ad9afa1656 Add the isUnresolvedIdentifier flag for ErrorCode.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32124
Change-Id: I8d69113d29cb20f0426924a1ea049f9daa53d803
Reviewed-on: https://dart-review.googlesource.com/48780
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-29 20:48:28 +00:00
Konstantin Shcheglov 14806df576 Make correction parameter optional named in ErrorCode and subclasses.
This is a preparatory step before adding a flag that signals
that the error code represents an unresolved identifier situation.

R=brianwilkerson@google.com

Change-Id: Ic3b30e2efae7ee0c12a40d1cc2bd48c14185d926
Reviewed-on: https://dart-review.googlesource.com/48763
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-29 19:59:13 +00:00
Konstantin Shcheglov 98f627f989 Issue 32708. Make GenericFunctionTypeElementForLink implement GenericFunctionTypeElementImpl.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/32708
Change-Id: I50e3bf46ca276dbffed9cccb39d800bebb9aec68
Reviewed-on: https://dart-review.googlesource.com/48761
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-29 19:47:29 +00:00
Konstantin Shcheglov 3306aabd82 Fix for type inference from instance creation arguments.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I0e8386f2a7b3e6d034350a21e474fc1a297c0120
Reviewed-on: https://dart-review.googlesource.com/48762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-29 19:44:20 +00:00
Brian Wilkerson 055dfad887 Fix the test to determine whether a library is in the SDK
Change-Id: I711daae49f27ca21fb4adce3c10ccb1bfc9d72a8
Reviewed-on: https://dart-review.googlesource.com/48760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-29 17:29:19 +00:00
Paul Berry 506ac7f953 Rework linker type inference using ExprBuilder.
This CL changes the way linker type inference works.  Instead of
walking the operations in an UnlinkedExpr in order and inferring types
directly, it first builds an AST for the expression using ExprBuilder,
then uses ResolverVisitor to resolve the AST and perform type
inference.

This helps ensure that summary type inference and ordinary AST-based
type inference produce the same result, since they now use the same
core algorithm.  In particular, this means that summary type inference
now does downwards inference properly.

Since the ResolverVisitor makes greater use of the element model than
the rest of the linker, this required implementing additional methods
in the linker's element model.

This CL includes some minor fixes to ExprBuilder that were uncovered
during testing.  It also contains some minor changes to
ResolverVisitor to make it work during linking.

Fixes #32525.
Fixes #32394.

Change-Id: I5ec9b2bf5565ad30b8cc856475334323dc118da8
Reviewed-on: https://dart-review.googlesource.com/48741
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-29 17:16:39 +00:00
Paul Berry 494b861d00 Further prep work for #32525.
This CL refactors the bodies of the following methods so that they can
be re-used by the summary linker:

- CompilationUnitElementImpl.getType
- LibraryElementImpl.createLoadLibraryFunction
- LibraryElementImpl.getImportsWithPrefix
- LibraryElementImpl.getType

Change-Id: I9b398d87323eb9ec6deb9a9a76bd6e9a1aa6bb76
Reviewed-on: https://dart-review.googlesource.com/48740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-29 16:58:30 +00:00
Brian Wilkerson 7470f410dd Clean up documentation of command-line analyzer options
Change-Id: If37cfbd7f1187229ab90205e59a7eb60d3b884cf
Reviewed-on: https://dart-review.googlesource.com/48701
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-28 21:15:58 +00:00
Paul Berry be3baa0b8f Additional ExprBuilder implementation.
This CL makes the following improvements:

- Makes ParameterElementImpl._unlinkedParam public so that it can be
  used by the ExprBuilder.

- Adds logic to ExprBuilder to create elements for closure parameters
  and to resolve references to those elements.

- Adds support for async closures.

- Adds support for nested closures.

Change-Id: I4b2c2271dac44bb54eb12049de7143b14adef84a
Reviewed-on: https://dart-review.googlesource.com/48680
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-28 18:55:29 +00:00
Paul Berry ebdee7ee0f More prep work to allow the linker to re-use resolution logic.
See #32525.

This CL makes the following changes:

- Extracts the logic from AbstractClassElementImpl.getSetter to a
  static method so it can be re-used by the summary linker.

- Modifies ParameterElementImpl._resynthesizeTypeAndParameters so that
  it avoids unnecessary calls to resolveLinkedType.  This is crucial
  because resolveLinkedType is not available when linking.

- Makes it possible to suppress reporting of const evaluation errors
  when doing resolution.  This is necessary because in order to report
  these errors we must do constant evaluation, which is not possible
  during summary linking.

- Modifies ResolverVisitor._hasSerializedConstantInitializer to avoid
  unnecessary calls to LibraryElementImpl.hasResolutionCapability.
  This is crucial because the linker contains an implementation of
  LibraryElementImpl that's incompatible with
  LibraryElementImpl.hasResolutionCapability.

Change-Id: Iec91bd8d6a68193e091c2438bafcd7cb15488d89
Reviewed-on: https://dart-review.googlesource.com/48681
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-28 16:54:44 +00:00
Paul Berry 91e6c8b019 Fix missing_return warning in expr_builder.dart
Change-Id: Ia1157d668f46114ded9f017dce3b11e202c6a76b
Reviewed-on: https://dart-review.googlesource.com/48561
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-28 07:53:04 +00:00
danrubel b82e5b4704 Replace code completion usage of token.previous with findPrevious
This CL is the first in a multi-part effort to remove the `previous`
field from the Token class. This first step introduces a new findPrevious
utility method that finds the the token before a given token in a token stream,
and then replaces usages of token.previous with calls to this
new findPrevious utility.

Change-Id: I57de4e542adb5950f1bddd951ff555dd98b19b3b
Reviewed-on: https://dart-review.googlesource.com/48461
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-28 02:27:54 +00:00
Konstantin Shcheglov 0e8457c8c8 Fix for building sequence of identifiers and several tests.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/32525
Change-Id: Iddc0a4825e98bf186e6c3da0fd24c81a95b96522
Reviewed-on: https://dart-review.googlesource.com/48501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-28 01:36:25 +00:00
Konstantin Shcheglov 28c4de8207 Resynthesize more expressions in ExprBuilder.
One thing that occurred to me is that maybe we don't need precise
resynthesis of some expressions, e.g. `a is T`, because it does not
have dependencies, and has known type. Thoughts?

We already kind of went this way by not serializing arguments of
invocations with type arguments, and cascades.

OTOH, it might be simplier to resynthesize where it is easy.

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/32525
Change-Id: I742b1adc6ae22d8743ef127af7d6a33446e53449
Reviewed-on: https://dart-review.googlesource.com/48466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-27 18:54:23 +00:00
Paul Berry 7df4235587 Make _ConstExprBuilder re-usable.
This CL moves _ConstExprBuilder to its own file, renames it to
ExprBuilder (so that it can be re-used for non-const expressions), and
begins adding support for expression types that can appear in
non-const expressions.

It also introduces an expr_builder_test.dart file to make testing of
ExprBuilder easier.

See #32674.

Change-Id: I5a3d91408c51770ee8f70621032a2f0767eaea55
Reviewed-on: https://dart-review.googlesource.com/48462
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-27 15:49:35 +00:00
Paul Berry af4ec9b4a3 More refactoring in preparation for #32525
This CL makes the following changes:

- Extracts the implementation of ClassElementImpl.getNamedConstructor
  to a static method so that it can be re-used by
  ClassElementForLink_Class.

- Adds a UnitResynthesizerMixin class so that unit resynthesis methods
  can be shared between the resynthesizer and the linker.

Change-Id: I694d6fef511b5bb734ea78095834d6c68e22bf63
Reviewed-on: https://dart-review.googlesource.com/48380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-26 17:39:59 +00:00
Paul Berry 761980b44a Rework typesWithImplicitTypeArguments as an expando.
An expando is a better conceptual fit, since we are using
typesWithImplicitTypeArguments as a substitute for adding a new
property to every DartType object.  Using an expando rather than an
identity set also has the advantage of interacting better with the
garbage collector, since the expando only has weak references to its
keys.

Change-Id: I39f538bd40b5ef264d637dbc8fafc11194ae27fa
Reviewed-on: https://dart-review.googlesource.com/48321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-26 08:35:55 +00:00
Brian Wilkerson c3d5537d38 Gracefully handle an invalid .packages file (issue 32560)
Change-Id: I1ff97c92b4e3ae17a0169f47e360d8e28d2e2524
Reviewed-on: https://dart-review.googlesource.com/48340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-25 19:20:54 +00:00
Paul Berry ca47fd7ef2 Allow type propagation to be disabled in StaticTypeAnalyzer.
I intend to re-use StaticTypeAnalyzer for performing type inference
during summary linking as part of fixing #32525.  Allowing type
propagation to be disabled will allow the linker to do less work, and
avoid the need to implement the type-propagation-related element
methods in the linker's reduced element model.

There should be no functional change with this CL, since
StaticTypeAnalyzer is not used in linking yet.

Change-Id: I5f644e9869ab89dee21b03a3a54bf809926142f5
Reviewed-on: https://dart-review.googlesource.com/48082
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-24 11:20:53 +00:00
Paul Berry ebd06f7b37 Make it easier for element model logic to be shared with linker.
I intend to fix #32525 by re-using resolver code to perform type
inference during summary linking.  This will require the linker's
stripped down element model to be filled out more completely.  To
avoid code duplication, I need to first refactor some of the existing
element logic so that it can be re-used by linker code.

This CL makes the following changes:

- LibraryElementImpl._unlinkedDefiningUnit is made non-private so that
  the linker will be able to implement it.

- The logic for building a set of import elements from a summary is
  moved to a reusable static method.

- The logic for building a set of prefix elements from import elements
  is moved to a reusable static method.

- In resynthesize.dart, abstract base classes are created for
  _LibraryResynthesizer, _ReferenceInfo, and _UnitResynthesizer.

- Also in resynthesize.dart, mixins are created to allow re-use of
  some of the implementation logic in _LibraryResynthesizerContext and
  _LibraryResynthesizer.

Change-Id: I34cde04f4aac291e216004e861d6ac354d551c1c
Reviewed-on: https://dart-review.googlesource.com/48081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-03-24 11:20:25 +00:00
Konstantin Shcheglov 96b76aa4fb Revert "Revert "Create new AnalysisSession instance on changes.""
This reverts commit 1caf7b7ecd.

R=brianwilkerson@google.com

Change-Id: I52c9628afe5d3df94801dc793217c9adf4ea82fe
Reviewed-on: https://dart-review.googlesource.com/48085
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-23 17:07:59 +00:00
Alexandre Ardhuin 9b2803f048 allow linter to enable previewDart2
Closes #32644
https://github.com/dart-lang/sdk/pull/32644

GitOrigin-RevId: 825c65da08d902c3fcd8984b055702a2e261ca72
Change-Id: Ia214040cb1918db130b41d4c50f1d3082ca734b6
Reviewed-on: https://dart-review.googlesource.com/47980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-23 04:34:55 +00:00
Konstantin Shcheglov 1caf7b7ecd Revert "Create new AnalysisSession instance on changes."
This reverts commit 8eb9f3db80.

New sessions, and corresponding InconsistentAnalysisException, cause
breakages in dartwing and pageloader3.

I plan restoring this in a week from now.

R=brianwilkerson@google.com

Change-Id: I88cbb0b6a50138fabed6798aa844c29f0e2a7b24
Reviewed-on: https://dart-review.googlesource.com/47901
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-22 17:58:19 +00:00
Konstantin Shcheglov c90ca298ed Provide a message for InconsistentAnalysisException.
R=brianwilkerson@google.com

Change-Id: I1498c70c1c9d7cd43760ca2c620a3fb819a0c823
Reviewed-on: https://dart-review.googlesource.com/47903
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-03-22 17:54:59 +00:00
Brian Wilkerson 26c06cdd82 Clean up Dart 2 type issues related to YAML support
Change-Id: Ic29054afca9773286aa899eecede287f7ecbca9a
Reviewed-on: https://dart-review.googlesource.com/47680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-03-22 17:06:40 +00:00
Peter von der Ahé b4206bb92c Remove dartk
Change-Id: Iac6cea06fd5ec6b37ded21943f59013c94d0d16f
Reviewed-on: https://dart-review.googlesource.com/47440
Reviewed-by: Jens Johansen <jensj@google.com>
2018-03-22 08:58:59 +00:00