Commit Graph

7628 Commits

Author SHA1 Message Date
Konstantin Shcheglov b255f0fab6 Resolve required arguments after named.
Change-Id: I2947be1fc20b1455e7865c34e35349977d61f70b
Reviewed-on: https://dart-review.googlesource.com/71382
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-23 22:04:12 +00:00
Sam Rawlins ff3908d6df Implement INVALID_SEALED_ANNOTATION analyzer Hint
This follows the pattern of other meta-annotations, when it comes to the AST:

* Element gains a new `hasSealed` getter. Many overrides.
* ElementAnnotation gains a new `isSealed` getter.

Bug: https://github.com/dart-lang/sdk/issues/34232
Change-Id: If8ae8e16b500125cb3b92b3cf83d46de6ca6ee23
Reviewed-on: https://dart-review.googlesource.com/71227
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 22:03:22 +00:00
Konstantin Shcheglov 955ca3ef87 Use SUPER_AS_EXPRESSION for SuperAsIdentifier.
Change-Id: I7bcbcc51739f01532f4723cf39c25a620f77f8b0
Reviewed-on: https://dart-review.googlesource.com/71364
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-23 21:48:27 +00:00
Brian Wilkerson 7b87c7abeb Fix escape processing in interpolated strings
Change-Id: If4ed614f75a9eb1a0f42cb602fd1236cada31dd3
Reviewed-on: https://dart-review.googlesource.com/71362
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 19:25:56 +00:00
Paul Berry 630929edf2 Test analyzer/FE integration of some more obscure invalid assignment cases.
This CL tests proper handling of the following erroneous assignments:
- Compound assignment to prefix increment (e.g. "++x += y;")
- Null aware assignment to prefix increment (e.g. "++x ??= y;")

Change-Id: I090ba2dacd754372674276b9fea3945588f3a731
Reviewed-on: https://dart-review.googlesource.com/71360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-23 19:11:15 +00:00
Konstantin Shcheglov 19a17e66fd Fix constant evalutation for == and != when left or right is null.
Change-Id: Iefa0890b57a9ba01675ce80c81fd3a73511f8c82
Reviewed-on: https://dart-review.googlesource.com/71340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-23 18:18:51 +00:00
Paul Berry a94e43af7c Fix analyzer/CFE integration of some more obscure invalid assignment cases.
This CL fixes handling of the following erroneous assignments:
- Compound assignment to postfix increment (e.g. "x++ += y;")
- Null-aware assignment to postfix increment (e.g. "x++ ??= y;")

There is some code duplication in ContextAwareGenerator now; I will
clean that up in a follow-up CL.

Change-Id: If68bc267b67904562bf8c2e705123d04fdf0b69a
Reviewed-on: https://dart-review.googlesource.com/71321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-23 17:31:48 +00:00
Brian Wilkerson 4212a46dab Add failing tests for handling of comment refs by fasta parser
Change-Id: I02bfbf2354ccf49bf6c3ea4968bb916f06b34c07
Reviewed-on: https://dart-review.googlesource.com/71320
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 17:11:47 +00:00
Konstantin Shcheglov 7e39d07916 Resolve namespace combinators.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/33636
Change-Id: I4f16eec2dcb5805663c0118d221f8ad8710cf3f8
Reviewed-on: https://dart-review.googlesource.com/71220
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-23 16:08:45 +00:00
Brian Wilkerson 3a6663f2d4 Update comparison utility to fix a bug and make it easier to subclass
Change-Id: I34447bb530215938da929320904c26fd7ef39771
Reviewed-on: https://dart-review.googlesource.com/71226
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 14:43:31 +00:00
Daniel Hillerström 23e379d0aa Checks whether an interface is implemented multiple times.
It is a compile-time error if an interface appears multiple times
across the extends and implements clauses.

This CL implements a check to detect the aforementioned case. A
previous commit implemented this by expanding and refactoring the
restricted super types check in source_loader.dart
(c.f. checkSemantics method). The restricted super types check decides
whether a type is allowed to appear in an 'extends', 'implements', or
'with' clause. However, it turned out it may have sat too early in the
compilation pipeline as it failed to detect the following case

   class A implements Object {}

I decided that it was somewhat suboptimal to implement a special case
for "Object". Therefore I have moved the check to a later stage in the
pipeline, where classes without a super class have had the Object
class injected as their default super class. The check is now
implemented in kernel_class_builder.dart (c.f. checkSupertypes
method).

Closes https://github.com/dart-lang/sdk/issues/34193

Change-Id: Ie7153c896337b589118cac4b80e9df8ea5a09daa
Reviewed-on: https://dart-review.googlesource.com/70864
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-23 14:36:40 +00:00
Brian Wilkerson b8ee603eb2 Deprecate the EMPTY_LIST constants in analyzer
Change-Id: I4c85c8c21207c86003cdb47d499ae9a934606889
Reviewed-on: https://dart-review.googlesource.com/71234
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-23 14:32:20 +00:00
Paul Berry f074f3c120 Fix analyzer/FE integration of some obscure invalid assignment cases.
This CL fixes handling of the following erroneous assignments:
- Assignment to postfix increment (e.g. "x++ = y;")
- Assignment to prefix increment (e.g. "++x = y;")
- Prefix increment of postfix increment (e.g. "++x++;")

Change-Id: I651c7cbcc4b3d43f7008f9d583e2057db9bc6e6e
Reviewed-on: https://dart-review.googlesource.com/71260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-23 13:48:43 +00:00
Paul Berry ad6f89f13b Fix analyzer/FE integration of postfix-of-postfix and prefix-of-prefix increments.
These cases don't appear to be exercised by language_2 tests, so no
language_2 tests are fixed by this CL.  I've added test cases to the
analyzer's driver_resolution_test to validate the fix.

Change-Id: I4a364e78f95981e94b51cf94d6f3236b022d42b8
Reviewed-on: https://dart-review.googlesource.com/71229
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-23 12:49:11 +00:00
Brian Wilkerson de3570d8bd Add support for the new mixin feature to the element model
Change-Id: I99344c387c4138438d3d7390bfce15b12e0073ab
Reviewed-on: https://dart-review.googlesource.com/71221
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-23 00:19:06 +00:00
Paul Berry e2aceb692e Fix analyzer/FE integration of prefix/postfix increment of non-l-values.
Fixes 2 language tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I74f98f328c203fb68d8ebf819230dbe9405cfc7d
Reviewed-on: https://dart-review.googlesource.com/71225
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-22 21:57:21 +00:00
Paul Berry 43a8f1d0d6 Fix analyzer/FE integration of assignment with synthetic LHS, inside class method.
Error recovery generates a slightly different kernel representation
for "= x" inside a class method vs. outside a class method.  Inside a
class method, the synthetic LHS is a property access; outside a class
method it is a variable access.  The "outside a class method" case was
addressed in 55aa031404f36d181daf5f5b27424da431ee2e3e; this CL
addresses the "inside a class method" case.

Fixes 1 language test with [ $compiler == dart2analyzer && $fasta ].

Change-Id: Ib9429cac13b775a7d0b40a13468117c442611531
Reviewed-on: https://dart-review.googlesource.com/71223
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-22 20:31:24 +00:00
Konstantin Shcheglov cf1cd3eba0 Resolve metadata for part-of directives.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/33795
Change-Id: Ie2eac3694d2eacbb6619abb47cf9630555a21939
Reviewed-on: https://dart-review.googlesource.com/71186
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-22 19:00:13 +00:00
danrubel cd970b0927 Parser refactoring in preparation for mixin declaration support
This is a bunch of renames and cleanup in preparation for
my next CL with basic mixin declaration support.

Rename listener events:
* handleClassImplements to handleClassOrMixinImplements
* beginClassBody to beginClassOrMixinBody
* endClassBody to endClassOrMixinBody

Rename parser methods:
* parseClassMember to parseClassOrMixinMember
* parseClassBody to parseClassOrMixinBody
* skipClassBody to skipClassOrMixinBody

Also:
* Change test expect from "ClassBody" to "ClassOrMixinBody"
* Rename message ExpectedClassBody to ExpectedClassOrMixinBody
* Update text of MISSING_CLASS_BODY to include mixin
* Rename IdentifierContext.classOrNamedMixinDeclaration to classOrMixinDeclaration
Change-Id: Iaa554cc859e1e665475c0eb544895a311c06395a
Reviewed-on: https://dart-review.googlesource.com/70881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-22 17:57:09 +00:00
Konstantin Shcheglov 5b9a42de29 Store code ranges for formal parameters.
Change-Id: I022e5140869c7007c28109a4dfda3914b34c4725
Reviewed-on: https://dart-review.googlesource.com/71184
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-22 17:40:58 +00:00
Aske Simon Christensen a4b3009ca5 Require super initializer to be at the end of the initializer list.
Drops code to handle special evaluation order rules for super
initializer before the end.

Initializer check code now also recovers from initializer errors.

Fixes https://github.com/dart-lang/sdk/issues/33101

Change-Id: I1024853bfd3acfef42630bdc2fc47782746b07c0
Reviewed-on: https://dart-review.googlesource.com/68060
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-22 10:43:08 +00:00
Daniel Hillerström 5780deb18a Signal a compile-time error when a type variable name conflicts with a setter name.
Specification disallow name conflicts between
  - type variables and class names
  - type variables and getter names
  - type variables and member names

Although not present in current specification, the language team confirms that
it is also supposed to be a compile-time error if there is conflict with a setter.

Closes https://github.com/dart-lang/sdk/issues/33827

Bug:
Change-Id: Ia25bc91c3287f93ae43faae121a1f9d81b179c6b
Reviewed-on: https://dart-review.googlesource.com/70500
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-22 06:55:22 +00:00
Paul Berry 40d72aec8c Re-land "Fix analyzer/FE integration of assignments to ambiguous types."
This reverts commit 9f795883f1.

Change-Id: I485d0722fe8651212660dc961ae9271045ee0c54
Reviewed-on: https://dart-review.googlesource.com/71100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-22 03:13:21 +00:00
Konstantin Shcheglov 9ef53bde19 Store codeOffset/length code fields and top-level variables.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I4590a38245039a4c60144feab039cf8d0db00677
Reviewed-on: https://dart-review.googlesource.com/71040
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-22 01:53:36 +00:00
Konstantin Shcheglov 675b296d49 Store code range for constructors.
Change-Id: I3de1349158e5b6c372c6be246ffdcc599a1baeb9
Reviewed-on: https://dart-review.googlesource.com/71042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-22 00:09:58 +00:00
Paul Berry 9f795883f1 Revert "Fix analyzer/FE integration of assignments to ambiguous types."
This reverts commit 1b5d273fd7.

Reason for revert: Windows bot breakage

Original change's description:
> Fix analyzer/FE integration of assignments to ambiguous types.
> 
> Fixes 2 language_2 tests with [ $compiler == dart2analyzer && $fasta ].
> 
> Change-Id: I600c7f075d0beb31863a4d17a6764afa2c7187be
> Reviewed-on: https://dart-review.googlesource.com/70982
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

Change-Id: Iaefb47e983266d2c81b8beb3c8a5b85eac345be8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/71080
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 23:52:28 +00:00
Paul Berry 55aa031404 Fix analyzer/FE integration of assignment with synthetic LHS.
This is a step toward fixing test arg_param_trailing_comma_test/166
with [ $compiler == dart2analyzer && $fasta ], since parser error
recovery handles that case by producing an assignment with a synthetic
LHS.

Change-Id: I5c998d335758d79dc0f13988c259b85e87051a08
Reviewed-on: https://dart-review.googlesource.com/71041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 22:36:27 +00:00
Konstantin Shcheglov 306141999d Update testing for unresolved invoke types.
R=brianwilkerson@google.com

Change-Id: Ib9a2d0027775c89c84d6bde943406ae0606927fd
Reviewed-on: https://dart-review.googlesource.com/71000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-21 21:42:24 +00:00
Konstantin Shcheglov 34e6aa8ad2 Fix mock SDK and front-end targer in analyzer.
R=brianwilkerson@google.com

Change-Id: I7d4a1948fe21720c237f6e36997d29e63dd7ab28
Reviewed-on: https://dart-review.googlesource.com/70983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-21 21:42:23 +00:00
Paul Berry 1b5d273fd7 Fix analyzer/FE integration of assignments to ambiguous types.
Fixes 2 language_2 tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I600c7f075d0beb31863a4d17a6764afa2c7187be
Reviewed-on: https://dart-review.googlesource.com/70982
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 21:13:18 +00:00
Konstantin Shcheglov 4a4132ccab Change code ranges for fields/variables.
We used to set the code range of the whole FieldDeclaration for each
individual VariableDeclaration even when there are multiple of them.

Now the first VariableDeclaration will use code range that starts at
the beginning of the FieldDeclaration, and ends at the end of its
initializer. The subsequent variables (if any) will start of the
start of their names. So, each variable will get unique code range.

R=brianwilkerson@google.com

Change-Id: I0a93bdad2a17454fd5b343b395c72440c86b421d
Reviewed-on: https://dart-review.googlesource.com/70981
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-21 20:57:16 +00:00
Paul Berry e87efdffb4 Fix analyzer/FE integration of assignments to ambiguous types.
Fixes 1 language test with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I807ca277e6e1f6fb81954be5e72b42cdec8c1b68
Reviewed-on: https://dart-review.googlesource.com/70961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 19:27:37 +00:00
Konstantin Shcheglov 8c82098b39 Remove special ignoring MissingImplementationCause.
A more general mechanism was implemented soon after.

R=brianwilkerson@google.com

Change-Id: I20a2b2fbd07720caf78519a3791dff8803f7df41
Reviewed-on: https://dart-review.googlesource.com/70901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-21 18:17:05 +00:00
Paul Berry d10204f3a0 Fix analyzer/FE integration of assignments to non-l-values.
This required introducing a new generator type to represent a
non-l-value, so that we can re-use the machinery of DelayedAssignment.

Fixes 6 language_2 tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: Ida2985df6d798d5466948e5de3dce5c17c2de7ac
Reviewed-on: https://dart-review.googlesource.com/70842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 16:45:07 +00:00
Brian Wilkerson 8b125b55d0 Add an AST structure for the new mix-in support
Change-Id: I3d8890edf26eeb19eaaab9c27772e2c37c10e629
Reviewed-on: https://dart-review.googlesource.com/70141
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-08-21 16:39:41 +00:00
Kevin Millikin 2a36502b02 Squelch some false warnings for disallowed uses of void
The rules for void are changed to allow uses of void where we
previously had a warning, such as the case of assignment to a
variable of type void or passing as a parameter of type void.

Change-Id: I1c1513b0000fa1c8eedbe2645fab503b28024fa3
Reviewed-on: https://dart-review.googlesource.com/70265
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-08-21 09:48:44 +00:00
Jens Johansen bedc1440d0 Analyzer: replaceComponent: Add small to big instead of the other way around
Instead of adding a big (old) map to a small (new) map and clearing the old
one, add the new entries the old map and let GC take the new map.

--use-cfe analysis-server-cold goes from ~48 to ~43 on my machine.

Change-Id: Ia0ff7bc4cafcea8e11fd9eb4eebd0cfec504b96f
Reviewed-on: https://dart-review.googlesource.com/70643
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-21 05:58:47 +00:00
Paul Berry a814614cf4 Fix analyzer/FE integration of invalid assignments to classes.
To ensure that the resolution of the class name is communicated to the
analyzer, we take advantage of SyntheticExpressionJudgment.original,
which allows us to ensure that type inference is performed on a
synthetic read of the class name expression.  This causes the
appropriate information to be communicated to the analyzer, and then
at runtime the value produced by the synthetic read is discarded.

Fixes 15 language_2 tests with [ $compiler == dart2analyzer && $fasta ].

Change-Id: I02ad23acbb64c297129f59ff56171399bf067c33
Reviewed-on: https://dart-review.googlesource.com/70780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-08-21 00:27:28 +00:00
Jens Johansen 59833ed175 Analyzer: Clear old metadata
Before:
```
$ out/ReleaseX64/dart pkg/analysis_server/benchmark/benchmarks.dart run
--use-cfe analysis-server-cold
Running analysis-server-cold 3 times...
  {analysis-server-cold-analysis: {micros: 46635813},
analysis-server-cold-memory: {bytes: 1878681920}}
  {analysis-server-cold-analysis: {micros: 46983169},
analysis-server-cold-memory: {bytes: 1880458816}}
  {analysis-server-cold-analysis: {micros: 46840261},
analysis-server-cold-memory: {bytes: 1878427424}}
Finished in 141 seconds.

{"benchmark":"analysis-server-cold","result":{"analysis-server-cold-analysis":{"micros":46635813},"analysis-server-cold-memory":{"bytes":1878427424}}}
```

Now:
```
$ out/ReleaseX64/dart pkg/analysis_server/benchmark/benchmarks.dart run
--use-cfe analysis-server-cold
Running analysis-server-cold 3 times...
  {analysis-server-cold-analysis: {micros: 47372081},
analysis-server-cold-memory: {bytes: 971048688}}
  {analysis-server-cold-analysis: {micros: 46993086},
analysis-server-cold-memory: {bytes: 970874400}}
  {analysis-server-cold-analysis: {micros: 47544922},
analysis-server-cold-memory: {bytes: 989676496}}
Finished in 143 seconds.

{"benchmark":"analysis-server-cold","result":{"analysis-server-cold-analysis":{"micros":46993086},"analysis-server-cold-memory":{"bytes":970874400}}}
```

So it basically uses half the memory...

Change-Id: Ica28572d58800bfa5663bfd1bbe99844eb3fd937
Reviewed-on: https://dart-review.googlesource.com/70506
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-20 08:57:20 +00:00
Jens Johansen 4179fbcec7 Only compute canonical names and clean new libraries
analysis-server-cold-analysis reduced from
~70 seconds to ~46 seconds.

Change-Id: I6e793f292beceda32817675625df90cd003bc19c
Reviewed-on: https://dart-review.googlesource.com/70264
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-20 08:14:49 +00:00
Mike Fairhurst 222ac2498a Revert "Fix #33415 no error for awaiting a void expression."
This reverts commit 9727a4a4ef.

Reason for revert: Internal breakage; needs to be landed behind a flag.

Original change's description:
> Fix #33415 no error for awaiting a void expression.
>
> Bug:  33415
> Change-Id: I4d4e81fef79a5bc5162e37ab07a8fe99e50c8dfc
> Reviewed-on: https://dart-review.googlesource.com/60522
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=brianwilkerson@google.com,mfairhurst@google.com


Bug: 33415
Change-Id: I66e1bc58bc0966a2348804dbdef6f5901b6aaf55
Reviewed-on: https://dart-review.googlesource.com/67100
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-17 23:48:46 +00:00
Devon Carew 0c2d382a6e add the ability to set the analyzer's state location via an env variable.
Change-Id: I37d1599cb96db7c09f929a6e56f191cc7a969145
Reviewed-on: https://dart-review.googlesource.com/70540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-08-17 17:42:43 +00:00
danrubel 3987cd4616 Update parser tests to use new scanner
Change-Id: Ia46e2d85acfcd21d88ee97ede2d9ed66620ec618
Reviewed-on: https://dart-review.googlesource.com/70520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-17 16:45:02 +00:00
Aske Simon Christensen eb37da8344 It is an error if a final field is initialized by some, but not all, constructors
closes https://github.com/dart-lang/sdk/issues/33022

Change-Id: I96549fcb2650a6efd685de41c972fd30a345fcf3
Reviewed-on: https://dart-review.googlesource.com/66563
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-17 12:37:52 +00:00
Aske Simon Christensen f8a96b88e9 It is an error if a final field is not initialized.
Bug: https://github.com/dart-lang/sdk/issues/33022

This commit adds an error when a final field is not initialized at all
(and there is at least one generative constructor). A later commit
will add an error for the case where a field is initialized by some,
but not all, generative constructors.

A number of classes in the Dart2js and DDC support libraries use
uninitialized final fields to indicate getters in the corresponding
native classes. This commit adds a temporary whitelist for the
affected files, which can be removed when the fields have been
replaced by external getters.

This is tracked by https://github.com/dart-lang/sdk/issues/33762

Change-Id: I6b5cee230c7cd5554da2b61da7ebddb6b0b9396e
Reviewed-on: https://dart-review.googlesource.com/63781
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-08-17 12:37:52 +00:00
Leaf Petersen 891b7164ac Fix overly strict invalid return checking.
In changing the proposed spec to address comments in a way that was intended to be
non-breaking, I accidentally introduced some new (unintended) restrictions.  This
fixes the spec, rolls back the change in analyzer, and adjusts the language tests
appropriately.

Change-Id: I487b0eaacbfa1447d4ee909c0a56e435c2088990
Reviewed-on: https://dart-review.googlesource.com/70462
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-08-17 01:25:18 +00:00
Brian Wilkerson d772f40084 Add dummy test to prevent test failure from running no tests
Change-Id: I9379795edc2b84071a26447d4f5db1908527f17e
Reviewed-on: https://dart-review.googlesource.com/70420
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-16 23:41:11 +00:00
Brian Wilkerson d98e4cc2a9 Support parseArguments in the compatibility wrapper around the fasta parser
Change-Id: Iefb7a20f8bd6571bb021dea33454933c6962330f
Reviewed-on: https://dart-review.googlesource.com/70380
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-08-16 21:25:57 +00:00
Daniel Hillerström 0db6545b51 Illegal return type check for functions marked async* or sync*.
Extends the illegal return type check for async functions to cover
illegal return types for functions marked async* or sync* as well.

Adds new error messages for illegal return types of functions marked
async, async*, and sync*. These error messages conform with those
produced by the analyzer.

Closes https://github.com/dart-lang/sdk/issues/33068

Bug: www.dartbug.com/33068
Change-Id: I6d8690537139d3d094a4e295fcac9de4f4a7f0af
Reviewed-on: https://dart-review.googlesource.com/69581
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-16 07:07:40 +00:00
Dan Rubel ad6029c608 Update fasta parser to split ">>=" when parsing type var
Change-Id: Id60da00165ef1c7d9128985ccadef06f62637a24
Reviewed-on: https://dart-review.googlesource.com/70181
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-16 01:04:46 +00:00