Commit Graph

7628 Commits

Author SHA1 Message Date
Paul Berry adc7237ad6 During one-phase resolution, build local elements before resolving.
This is necessary because in certain circumstances the resolver needs
to consult the local elements.  For example, when analyzing the type
behavior of a `return` statement, it examines the enclosing function's
element to see if it is asynchronous.

Change-Id: Id5b5922c9f000e62d3b6f3fa0a9cecf1b3a1b0c4
Reviewed-on: https://dart-review.googlesource.com/74491
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-11 23:46:26 +00:00
Brian Wilkerson d78d494618 Update analyzer changelog prior to publishing
Change-Id: If09880ccf88d4e8dde2923db4779b04d3d47cebf
Reviewed-on: https://dart-review.googlesource.com/74541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 22:33:56 +00:00
danrubel a1a7b7eb14 Update error message translation
... and also auto generate more Analyzer error codes:
* COVARIANT_AFTER_VAR
* IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE
* INVALID_AWAIT_IN_FOR
* PREFIX_AFTER_COMBINATOR
* TYPEDEF_IN_CLASS

Change-Id: Ic436016058d5c33f54a3ca4ec72bf34954115877
Reviewed-on: https://dart-review.googlesource.com/74521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-11 22:29:45 +00:00
Mike Fairhurst 6784fb596f First wave of int2double -- accept doubles as ints except const
Change-Id: I79661b8cf6e1395302b03f1bd3d0260225ffc5e4
Reviewed-on: https://dart-review.googlesource.com/73841
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 22:00:48 +00:00
Brian Wilkerson 90189408c5 Prepare to publish analyzer (and associated packages)
Change-Id: Id54eb6c90c69e34be997068b149336a302774a23
Reviewed-on: https://dart-review.googlesource.com/74540
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 21:46:46 +00:00
danrubel 25d14df016 Auto generate more ParserErrorCodes
Specifically:
* CONTINUE_OUTSIDE_OF_LOOP
* EXTERNAL_CLASS
* EXTERNAL_ENUM
* STATIC_CONSTRUCTOR

Also:
* Exclude classes that are already auto generated from the list of those
  that could be translated,
* Print summary after checking for manual changes
* Generate error codes before checking if manual changes need to be made

And address comments in
* https://dart-review.googlesource.com/c/sdk/+/74040
* https://dart-review.googlesource.com/c/sdk/+/74240

Change-Id: I573215d58e14749edd02a2416389df3047841002
Reviewed-on: https://dart-review.googlesource.com/74520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-11 21:01:46 +00:00
Paul Berry 80fda41538 During one-phase summary generation, use ASTs for type inference.
There are some test failures introduced by this change.  I believe
they are due to pre-existing bugs, so I'll address them in a follow-up
CL.

Change-Id: I4e00083e53f92d5c8ac53a7a597b89496402aec4
Reviewed-on: https://dart-review.googlesource.com/74487
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-11 20:52:09 +00:00
Konstantin Shcheglov 70b586db5c Collect and store super-invoked names with tasks.
R=brianwilkerson@google.com

Change-Id: Ib396e9bb4ada38f4455958e0938b83097a2c7e25
Reviewed-on: https://dart-review.googlesource.com/74484
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 19:54:28 +00:00
Konstantin Shcheglov a02a589813 Keep just one UNDEFINED_GETTTER/METHOD/SETTER error.
There is no distinction between them from the langauge of view anymore.

This is a preparatory step before reporting super-invoked abstract
class members as errors, which we should do according to the issue.

Which, in turn, is for consistency between repoting corresponding
error for super-invoked, but not concrete members in mixin applications.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33662
Change-Id: I00e8f185dbbdd1ffac88c500394a1e1497be6f9a
Reviewed-on: https://dart-review.googlesource.com/74481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-11 18:40:02 +00:00
Brian Wilkerson 27984a4ba9 Add linter support for mixins
Change-Id: I7342a20554903b90ed4a48b014fadebe5eb9e7ee
Reviewed-on: https://dart-review.googlesource.com/74500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 18:39:42 +00:00
Kevin Millikin 2b296a0671 Enable mixin declaration syntax in Fasta
This enables mixin declarations for the Dart VM by parsing them into
class declarations.

Change-Id: Ic792009bc450d7c887f2e9962040ffad807881eb
Reviewed-on: https://dart-review.googlesource.com/74480
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-09-11 18:05:52 +00:00
Paul Berry 02d1fc5ba8 Add a ClassOrMixinDeclaration class.
This will be needed for summary logic, since summaries use a common
data structure to implement classes and mixins.  It seems like it
should also be useful to clients.  Note that it's a
backwards-compatible change in terms of the anaylzer API.

Change-Id: Id8e376f36a187578bd924bcf759c7384e5e96ce1
Reviewed-on: https://dart-review.googlesource.com/74326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-11 17:31:12 +00:00
danrubel d35c18999f Disallow type parameters of the form <X super Y>
Fix https://github.com/dart-lang/sdk/issues/28848

Change-Id: I1b8cd943b5af448fb6f5826d002d0b5a403e6bba
Reviewed-on: https://dart-review.googlesource.com/74241
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-11 15:30:03 +00:00
Konstantin Shcheglov 0eee800e1b Report INCONSISTENT_METHOD_INHERITANCE for mixins.
R=brianwilkerson@google.com

Change-Id: I4bfcbccd20049d80deaca346cabf580bdbcaf266
Reviewed-on: https://dart-review.googlesource.com/74320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-10 23:47:44 +00:00
danrubel c7960df357 Generate analyzer error codes from messages.yaml
With this change, analyzer error codes can be generated from messages.yaml
and those error codes easily translated from the corresponding fasta error.

Each fasta error code in messages.yaml that has an "index:" field
(see prior CL https://dart-review.googlesource.com/c/sdk/+/74040)
now has an Analyzer error code automatically generated
with the information in messages.yaml. In addition
a list of all indexed errors is generated so that a fasta error
code can be quickly translated into an Analyzer error code.

Change-Id: I2d534b7349590ddd54996f564db786c6ffe259b3
Reviewed-on: https://dart-review.googlesource.com/74240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 23:07:19 +00:00
Paul Berry d0a5a4c22b Convert summarize_const_expr.dart to triple-slash comment style.
Change-Id: I16bd72da03e05ad10ad32a087eb2607209d4bddf
Reviewed-on: https://dart-review.googlesource.com/74282
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-10 21:46:14 +00:00
Paul Berry d32f524bb3 Fix NamespaceBuilder._addPublicNames for mixins.
Change-Id: I642bfed0ed710d3b7a3746fe38ff399810a32d74
Reviewed-on: https://dart-review.googlesource.com/74264
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-10 21:39:42 +00:00
Brian Wilkerson 7fa80d8200 Remove unused error codes
Change-Id: I8e89c8f486ccfb1d294f753aff3c391c210c5778
Reviewed-on: https://dart-review.googlesource.com/74300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 21:18:02 +00:00
Konstantin Shcheglov ae2f75abec Report CompileTimeErrorCode.MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER.
R=brianwilkerson@google.com

Change-Id: I697327cb6b436b8b3448d91b23f720e758f52a51
Reviewed-on: https://dart-review.googlesource.com/74265
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 21:12:12 +00:00
Kevin Millikin cbfc78f5b2 Parse mixin declarations as if they were classes
In Fasta's outline builder, parse mixin declarations as if they were
the corresponding class declaration:

mixin M<T0,...,Ti> on S0,S1,...,Sj implement I0,...,Ik {...}

is parsed as if it were:

class M<T0,...,Ti> extends S0 with S1,...,Sj implements I0,...,Ik {
  ...
}

This supports the syntax and should automatically provide an
implementation of the runtime semantics on the VM.  Not all of the
required static checks are implemented in the front end.

Change-Id: Ice65e93446222484272f8f7db0de2d18c352f56b
Reviewed-on: https://dart-review.googlesource.com/73760
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-09-10 20:40:45 +00:00
Konstantin Shcheglov b6c98976d5 Report CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE for mixins.
R=brianwilkerson@google.com

Change-Id: I513d1026793829a3df7ad46ab40c9c4ddeb379be
Reviewed-on: https://dart-review.googlesource.com/74263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 20:30:23 +00:00
Konstantin Shcheglov 9281748a35 Check for conflicting static and instance members in mixins.
R=brianwilkerson@google.com

Change-Id: Ic3e816451b6a7d4bbf81ffef24be2154487b56f4
Reviewed-on: https://dart-review.googlesource.com/74261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 18:18:19 +00:00
Konstantin Shcheglov 3346632ad3 Report CompileTimeErrorCode.EXTENDS_NON_CLASS for mixins.
I'm also renaming an error to MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE,
because the spec says that `on` clause uses interfaces, not classes.

R=brianwilkerson@google.com

Change-Id: I561fd5605b66cf5a6e870c037ac16c43fc81b403
Reviewed-on: https://dart-review.googlesource.com/74260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 18:11:00 +00:00
Brian Wilkerson f649a1f3cc Add a missing error message (issue 34412)
Change-Id: I2f8042afba0d15adeb6f770859c3366273297c18
Reviewed-on: https://dart-review.googlesource.com/74200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-10 17:10:10 +00:00
Konstantin Shcheglov 63fbfcc69a Translate InvalidInlineFunctionType to ParserErrorCode.INVALID_INLINE_FUNCTION_TYPE.
R=brianwilkerson@google.com, danrubel@google.com

Change-Id: I2b1c7938c081b771e554149846c8157f8332e061
Bug: https://github.com/dart-lang/sdk/issues/33398
Reviewed-on: https://dart-review.googlesource.com/74043
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-09-10 16:08:41 +00:00
Konstantin Shcheglov 9e3bcc4cec Report MIXIN_INSTANTIATE when a mixin is instantiated.
R=brianwilkerson@google.com

Change-Id: Ia19d69bd7f0212bcdfb37f228046c727a36d62e3
Reviewed-on: https://dart-review.googlesource.com/74042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-09 17:04:48 +00:00
Paul Berry 9795cd9613 Remove uses of DartType from const expression serialization.
These types were used long ago when we sometimes generated summaries
from an element model; they haven't been used in a long time.

Change-Id: I73d5e52cc3c35ce1d5ebb68bae59c8a795ce279f
Reviewed-on: https://dart-review.googlesource.com/74013
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-08 00:02:59 +00:00
Paul Berry 13efc4f8d8 Convert test_strategies.dart to triple-slash comment style.
Change-Id: Ia6c1756d147040fec07aaed1f547b6b2c4a495b2
Reviewed-on: https://dart-review.googlesource.com/74011
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-07 23:14:11 +00:00
Konstantin Shcheglov c29ec5994c Resolve super invocations in mixin declarations.
R=brianwilkerson@google.com

Change-Id: I81dddc8187a13a17db91f77dc0df19248db7d45b
Reviewed-on: https://dart-review.googlesource.com/74007
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-07 20:06:21 +00:00
danrubel a9cc6f0f19 Revise with clause event handling
This replaces the begin/endMixinApplication events which were used in both
```
  class A = B with M;
```
and
```
  class A extends B with M { }
``
with different events for each of the above situations.
This change facilitates properly handling class declarations of the form
```
  class A with M { }
```

Removed event:
* beginMixinApplication
* endMixinApplication

Added events:
* handleNamedMixinApplicationWithClause
* handleClassWithClause
* handleClassNoWithClause

Change-Id: Ifa0ecfd7ff8c408087ad78036ad35ba4a00728c6
Reviewed-on: https://dart-review.googlesource.com/73940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-07 19:33:51 +00:00
Konstantin Shcheglov 1e65a6fa7f Check for conflicts of constructors and static members.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34371
Change-Id: I55494cbb770dbdc1418cac9c74672ebbab7ab24d
Reviewed-on: https://dart-review.googlesource.com/74004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-07 18:33:15 +00:00
Brian Wilkerson fe5a99dd75 Add hover support for mixin declarations
Change-Id: Ia42f39aec7b001264ae69043fe76ceb2c79b76cb
Reviewed-on: https://dart-review.googlesource.com/73960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-09-07 17:52:45 +00:00
Konstantin Shcheglov cbab413950 Collect super-invoked names for mixin declarations.
We need this to support the following requirement in the mixin
specification:

It's a compile-time error to apply a mixin containing super-invocations
to a class that doesn't have a concrete implementation of the
super-invoked members.

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

Change-Id: Ib683794fe7101222863b34956619773e2af52d1a
Reviewed-on: https://dart-review.googlesource.com/73780
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-07 14:25:45 +00:00
danrubel d761e97178 Remove WithWithoutExtends error code
Change-Id: I1bfe3721200493945580fa1e687ff565a7a79cf0
Reviewed-on: https://dart-review.googlesource.com/73820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-07 04:15:28 +00:00
Paul Berry 2fb058e873 Skip non-const expressions when performing one-phase summarization.
The only reason to include non-const expressions in an unlinked
summary is for type inference, but for one-phase summarization, we're
going to perform type inference directly based on the source AST.  So
skip non-const expressions when doing one-phase summarization.

This requires modifying several summary tests so that they no longer
expect the non-const expressions to be present in the unlinked
summary.  It also causes a few tests of one-phase summarization to
start failing, since the AST-based type inference logic hasn't been
implemented yet.  This is ok because one-phase summarization isn't
exposed to customers yet; it will be fixed in follow-up CLs.

Change-Id: I7455fd82b64c59362439206a05a9eb3691c8e397
Reviewed-on: https://dart-review.googlesource.com/73688
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-07 00:54:54 +00:00
Dan Rubel 7905136e64 Allow with clause without extends clause
This removes the code the generates an error when a `with` clause
is used without an `extends` clause as in
```
   class C with M { }
```
This is the first of several CLs to update the parser
as this CL only prevents the error from being generated.

Change-Id: I1d5c8577902e253a4c83cda2f6a1d4ab98319903
Reviewed-on: https://dart-review.googlesource.com/73687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-07 00:25:58 +00:00
Konstantin Shcheglov e13197d192 Update checks for conflicting class members.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34371
Change-Id: Ic056ff4b2f7c7105d12e9b439fcc0cd268cd5ac1
Reviewed-on: https://dart-review.googlesource.com/73301
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 22:56:06 +00:00
Konstantin Shcheglov ffc716addf Check that mixin superclass constraints are satisfied.
R=brianwilkerson@google.com

Change-Id: If0957b0868da7c7330bd561b6e91dfb0379fa226
Reviewed-on: https://dart-review.googlesource.com/73720
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 21:17:51 +00:00
Paul Berry 6ce37c6541 Convert summarize_ast.dart to triple-slash comment style.
I anticipate heavily modifying this file, and I don't want to have to
mix comment styles when I do so.

Change-Id: Ib93bf5489f080456da81f03f82bd7e850498748c
Reviewed-on: https://dart-review.googlesource.com/73683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 21:09:40 +00:00
Konstantin Shcheglov 230ff965da Report a compile-time error when type arguments after the constructor name with implicit new.
Bug: https://github.com/dart-lang/sdk/issues/34270
Change-Id: I38e919847f25d204c26ec74d04fa49cc46063434
Reviewed-on: https://dart-review.googlesource.com/73600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-06 19:54:50 +00:00
Paul Berry a5d9eb01c2 Convert link.dart to triple-slash comment style.
I'm going to be adding a lot of new functionality to this file, and I
don't want to have to mix comment styles when I do so.

Change-Id: I35fb7b93b2cfc200995364028ea10bab9c8f1245
Reviewed-on: https://dart-review.googlesource.com/73640
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 19:52:26 +00:00
Konstantin Shcheglov 8d9320f777 Test for mixin named 'on'.
Remove explicit _checkForImplementsDeferredClass(), some other mixin checks.

R=brianwilkerson@google.com

Change-Id: I134200d1e78315c19218cf7a9ff4efba7fc50fb8
Reviewed-on: https://dart-review.googlesource.com/73660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-06 19:47:12 +00:00
Paul Berry e72fd5294a Deprecate unneeded fields from PackageBundle.
Change-Id: I071a44499ef20a32388eea7ba04264c8c9b8e1c9
Reviewed-on: https://dart-review.googlesource.com/73285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 14:16:10 +00:00
Peter von der Ahé d1e2ee28f3 Remove addCompileTimeError in favor of addProblem
Replace most methods with names containing CompileTimeError with corresponding
Problem methods.

Also make Severity.error the default severity.

Change-Id: I4f47bf71dec02347407f2ce4ccfdb04730daf51b
Reviewed-on: https://dart-review.googlesource.com/73221
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-09-06 06:56:42 +00:00
Paul Berry a2f4ab5b52 Add an API for generating analyzer summaries in one step.
Currently, analyzer summaries are generated in a two-step process,
translating compilation units into unlinked summaries and then linking
the unlinked summaries together to form linked summaries.  In order to
support full unrestricted type inference, we'll need to build
summaries in one step, so that the full AST of initializers is
available for inference during linking.

This CL introduces a new API for one-step summarizing, along with test
cases to exercise it.  For now, the one-step summary logic just
invokes the old two-step summary process.  In future CLs I'll rework
it to be a true one-step summarizer so that the type inference
restrictions can be lifted.

Change-Id: Ic8d55850972f4697b5c6cc6fabe5d26dc7c1288c
Reviewed-on: https://dart-review.googlesource.com/73300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-06 04:18:46 +00:00
danrubel dc0aae5c44 Improve super initializer recovery
This CL addresses one of the issues in https://github.com/dart-lang/sdk/issues/34041
by fixing an AstBuilder crash and improving recovery of super constructor calls
in a constructor initializer list.

In addition, this adds a TestDescriptor adjustValidUnitBeforeComparison field
to support the new recovery tests.

Change-Id: I9e687aed34ea293700bd45d7c13ce36e83a00a05
Reviewed-on: https://dart-review.googlesource.com/73286
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-09-06 01:16:55 +00:00
Konstantin Shcheglov 169949985a Move CONST_WITH_TYPE_PARAMETERS reporting to ConstantVerifier.
Linter also should be updated to check for this error in HasConstantErrorListener.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33612
Change-Id: If4a2535ffe04d965bbd46b5c92679e6132bf500e
Reviewed-on: https://dart-review.googlesource.com/73283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-05 20:51:10 +00:00
Paul Berry 370c7b54f5 Further refactoring of summary tests
This CL makes the following changes:

- Makes `linkerInputs` private to the strategy classes (the only thing
  needed by tests is `testDartUri`).

- Changes the return type of addNamedSource to `void` (no caller was
  using the return value).

- Generalizes _FilesToLink so that it can be re-used for one-phase
  summary generation (where the inputs will be CompilationUnit objects
  rather than UnlinkedUnitBuilder objects).

- Moves _parseText to top level so that it can be more easily reused.

Change-Id: I333b278b9a157b5013199d0c21cc4c8d3423dbe7
Reviewed-on: https://dart-review.googlesource.com/73281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-05 20:31:12 +00:00
Konstantin Shcheglov 732a5e3ea8 Give import prefix type 'dynamic' when it is used as an expression.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34209
Change-Id: I6c393af70342037c496adebefaaf66c7a685852a
Reviewed-on: https://dart-review.googlesource.com/73240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-05 19:47:00 +00:00
Konstantin Shcheglov e7be010971 Safer FileSystemState.hasUri
SourceFactory.forUri2() can return null.

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33859
Bug: https://github.com/dart-lang/sdk/issues/33233
Change-Id: I34908cd9d04050cc2afcdc716c6bb68d4f177702
Reviewed-on: https://dart-review.googlesource.com/73242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-05 19:46:58 +00:00