Commit Graph

3345 Commits

Author SHA1 Message Date
Dan Rubel 4eb4d75270 Remove unused event parameter
Change-Id: I097886cae93204d671a3aca4caaafea8d117989d
Reviewed-on: https://dart-review.googlesource.com/70180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-16 01:04:46 +00:00
Dan Rubel 825df975a0 Revise fasta type arg/param parsing to ignore "<".endGroup
The scanner associates '<' with '>' and '>>',
but the parser cannot use '<'.endToken/endGroup reliably
and wastes time updating that token's endToken/endGroup field.

This CL updates type info parsing to ignore '<'.endGroup
and step through the token stream (which it has to do anyway),
for improved parsing.

This CL causes a handful of existing tests to fail (marked as @failingTest)
and test failures will be addressed in a subsequent CL.

Change-Id: I788e9a74cd2891f98f44bba15d5669febfec6c64
Reviewed-on: https://dart-review.googlesource.com/70001
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 22:16:40 +00:00
Brian Wilkerson 964a2fb9bb Produce fix when super constructor does not exist
Change-Id: I8186b42a938a3ad814e624ba5b378c130422209f
Reviewed-on: https://dart-review.googlesource.com/70080
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 13:24:32 +00:00
Brian Wilkerson 49437e3bae Split TooManyArguments to support quick fixes
Change-Id: I31511f619cafbce01f68d6e182328567a2bc3523
Reviewed-on: https://dart-review.googlesource.com/70021
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-15 13:24:22 +00:00
Daniel Hillerström b13c4e4c9f Updates status file to expect MissingCompileTimeError for illegal
async function return type check whenever running in 'legacy mode'.

Adapts language_2_kernel.status such that a MissingCompileTimeError is
expected for illegal return types of async functions when running in
'legacy mode'. Updates the commentary in finishFunction in
body_builder.dart.

Some legacy tests* have revealed that it may not always be correct to
check whether [strongMode] is enabled before checking the return type of
async functions. The reason behind the strongMode check was to ensure
that [_typeInferrer.typeSchemaEnvironment] would be instantiated as
per ahe's suggestion.

There seems to be some inconsistency in the code base as to when
[_typeInferrer.typeSchemaEnvironment] is non-null. For example, during
the fasta perf benchmarks one may observe a null value, whilst it
seems that the member is always non-null when running `dart
--no-preview-dart-2 <script.dart>`.

* test log: https://ci.chromium.org/p/dart/builders/luci.dart.ci.sandbox/front-end-legacy-linux-release-x64/621

Change-Id: I2211bfe0ae75a7aa35e2d698ff5cba27af484d07
Bug: 33425
Reviewed-on: https://dart-review.googlesource.com/69920
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-08-15 06:52:48 +00:00
Dan Rubel 0aeaef23e2 Remove parser reliance on "<".endGroup/endToken
This replaces calls to lt.endGroup when parsing type arg/param
with calls to computeTypeParamOrArg. This is a step towards
removing lt.endGroup everywhere and making type arg/param
parsing more resiliant and streamlined.

Change-Id: I5b3374769367f601c8910afa18116a2edd3f80c0
Reviewed-on: https://dart-review.googlesource.com/70000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-14 17:04:34 +00:00
Brian Wilkerson 5f4343f864 Remove the analyzer code from DuplicatedNamePreviouslyUsedCause
Change-Id: Ia605421652a045b282b856be1ecfe7bd086876d9
Reviewed-on: https://dart-review.googlesource.com/69801
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-13 22:37:27 +00:00
Dan Rubel 9619e2cd77 Remove unused fasta parser methods and event parameter
Change-Id: I0bf050a475ad3548342307027d14aba4badf468e
Reviewed-on: https://dart-review.googlesource.com/69620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-13 16:42:12 +00:00
Daniel Hillerström b244c0805d Extends the type checking of async functions to check whether the
declared return type of an async function is a super type of Future<T>
for any T.  In case the check is not successful an error message is
produced. The location of the name of the offending function
declaration is used as location information for message. Ideally we
would use the location of the type, so until types get annotated with
location information the error message remains suboptimal.

This closes #33425 and closes #34057.

Thanks to dmitryas and jensj for their helpful guidance.

Bug: dartbug.com/33425 dartbug.com/34057
Change-Id: I3b3dadc25b574422ea1f38671fe8cba3ffdd494c
Reviewed-on: https://dart-review.googlesource.com/69307
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-08-13 12:22:47 +00:00
Konstantin Shcheglov 5a2a13c8bf Store and resynthesize codeOffset/codeLength for functions and methods.
R=brianwilkerson@google.com

Change-Id: I2106fb407b7488eede8c06112f1ac582b92d6af5
Reviewed-on: https://dart-review.googlesource.com/69400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-10 21:37:02 +00:00
danrubel c3f5c07a47 Simple type argument parsing fixes and more tests
This fixes some of the event tokens when parsing simple type arguments
with '>>' or '>=', and organizes and adds more tests.
In addition, this addresses a comment in
https://dart-review.googlesource.com/c/sdk/+/69261

Change-Id: I16e3a5360ac2e62dd1853df946b88611ff099d94
Reviewed-on: https://dart-review.googlesource.com/69360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-10 18:58:32 +00:00
Konstantin Shcheglov 28583df3ee Store codeOffset / codeLength for classes.
Change-Id: Ief9d529df814d9b4f33f98c485de6b91c6bd2f69
Reviewed-on: https://dart-review.googlesource.com/69280
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-10 16:25:22 +00:00
Konstantin Shcheglov ac973e5ba7 Return SourceSpan with actual length from _CompilationMessage.
Change-Id: I883a4ce1b6fc63643db259a0d22e0719b460c109
Reviewed-on: https://dart-review.googlesource.com/69005
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-10 16:03:42 +00:00
Konstantin Shcheglov d69a354026 Put fileEndOffset into ArgumentsJudgment and use to report argument errors.
Change-Id: Id79bd71e7147be379e93024591134c12aa598a38
Reviewed-on: https://dart-review.googlesource.com/69221
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-10 15:40:37 +00:00
danrubel 8e2141f1cf Fix parsing typedefs with <T>=
This is the first CL of several needed to fix typedef parsing
when there is no space between the type parameters and the `=`.

  typedef F<T>= T Function(T);

* Fix some typedef parsing failures
* Add new consts for simple type var ending with ">>" and ">="
* Update computeType and computeTypeParamOrArg to return new consts
* Extract splitGtEq/GtGt/GtGtEq from splitEndGroup
* Hide internal TypeInfo and TypeParamOrArgInfo consts

Change-Id: Ice550f5b15df1f3cad616a2a342644974f14d8ee
Reviewed-on: https://dart-review.googlesource.com/69261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-10 15:09:21 +00:00
Vyacheslav Egorov bde6bbca96 [kernel] Move VmTarget and FlutterTarget to package:vm
Similar to how dart2js keeps its own target in package compiler.

This allows VmTarget to use package vm specific transformations and metadata.

Change-Id: I41dd2ae241b828224fb2c9a51e6ad5073b6fdea8
Reviewed-on: https://dart-review.googlesource.com/69160
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-10 12:55:57 +00:00
Aske Simon Christensen f2766eb24e Disallow references to this in field initializers.
Fixes https://github.com/dart-lang/sdk/issues/33858

Change-Id: I619de64353ac5131d949d8e3898617435e9f6dcc
Reviewed-on: https://dart-review.googlesource.com/68920
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-08-10 11:12:58 +00:00
Samir Jindel 5c7d257978 [kernel/vm] Fix native extensions.
Tested with imports through current directory, VM binary directory,
and LD_LIBRARY_PATH. This also restores the Dart 1 behavior of not supporting
relative extension paths.

Change-Id: I090bf8592fef74d4ccde40e6f550baa84c98e3bc
Reviewed-on: https://dart-review.googlesource.com/69162
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-08-10 11:06:56 +00:00
Aske Simon Christensen 8dbcb9b26d Remove co19 hack from part multi-use check.
Change-Id: I3b93d7c84f48730c570cffa7d508c9194508f1b2
Reviewed-on: https://dart-review.googlesource.com/60561
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-08-10 08:28:09 +00:00
Konstantin Shcheglov 29401573d5 Get documentation comments before metadata as well.
I think this is a quite often case in AngularDart.

/// Some comment.
@Component(...)
class MyComponent {...}

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

Change-Id: Icf6cff82db82e6641a37464e300c3daf50572368
Reviewed-on: https://dart-review.googlesource.com/69202
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 22:18:22 +00:00
Dan Rubel 1cd9175e3e Fix mixed dartdoc processing
This change should fix the failing ResynthesizeAstStrongTest.test_class_documented_mix test.

Change-Id: I0b89fa5ddbb4725ec0115836e8b5e801d18678c5
Reviewed-on: https://dart-review.googlesource.com/68900
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-08 14:59:13 +00:00
Kevin Millikin 35d26c9b14 Always use relative paths to import from within the front end
The style guide says to "PREFER relative paths when importing
libraries within your own package’s lib directory".  Mixing them with
package: imports doesn't work.  Before: we had a mix.  Now: we don't.

Change-Id: Iadcf1dda7bae51121e325f5d4b8c6add8759da95
Reviewed-on: https://dart-review.googlesource.com/68082
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2018-08-08 11:29:12 +00:00
danrubel 1f4449658d Refactor dartdoc parsing
This alters the way that dartdoc is parsed,
preventing null comment references from being pushed onto the stack.
This removes the need to remove those nulls prior to creating
the documentation comment AST nodes and allows for fixed sized lists.

This also address comments in:
* https://dart-review.googlesource.com/c/sdk/+/68520
* https://dart-review.googlesource.com/c/sdk/+/68461

Change-Id: I679c425b5d1f3f7954281d226815a80e73dcc033
Reviewed-on: https://dart-review.googlesource.com/68780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 22:28:55 +00:00
Konstantin Shcheglov c30af508a4 Store import prefix offset into metadata and resynthesize.
Change-Id: I7ef72c562323f132865c7cb6b3b068623c831043
Reviewed-on: https://dart-review.googlesource.com/68741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 18:17:46 +00:00
danrubel 98cf15cf5b Remove unnecessary commentToken parameter
Minor cleanup to the dartdoc parsing API

Change-Id: I7aa4c0116277beeef39553f1c133aa1ab8904d61
Reviewed-on: https://dart-review.googlesource.com/68700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-08-07 16:07:09 +00:00
danrubel 89fd468b89 remove unused DocumentationCommentToken.references field
Change-Id: Ia35dfe2c69d4f35d3a54dd0fcb026de23d888d1c
Reviewed-on: https://dart-review.googlesource.com/68520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 16:07:09 +00:00
danrubel 49b18446c2 Refactor dartdoc parsing
This extracts and refactors a sizable chunk of dartdoc parsing out of AstBuilder
and into the fasta parser. Parsing dartdoc does not happen unless the listener
calls the new fasta parser parseCommentReferences method.

The new parseCommentReferences method generates a handleCommentReferenceText
event for each comment reference encountered. The listener calls the scanner
to tokenize the comment reference and forwards the result to a new
fasta parser parseOneCommentReference method. This method generates either
a handleCommentReference or a handleNoCommentReference depending upon
whether or not a reference is parsed.

parser.parseCommentReferences
* generates handleCommentReferenceText events
* returns # of events generated

listener.handleCommentReferenceText
* calls parser.parseOneCommentReference

parser.parseOneCommentReference
* generates either handleCommentReference or handleNoCommentReference

There are further improvements to be made, but I believe this chunk
will allow progress to be made on the kernel side.

Change-Id: I393dc4d1d4791b3d7a529f6cb3c16db3a5befddf
Reviewed-on: https://dart-review.googlesource.com/68461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-07 16:07:09 +00:00
Jens Johansen f9e50baa0b Update formated error for nonexisting constructor
This is an alternative fix for #33452.
This was originally fixed in 8e4d5c0a38,
but it was pointed out that it doesn't work if there were type arguments.

This should fix the problem in more cases.

Change-Id: I08ed27ecea1a8d471be9675d28b997614248c65e
Reviewed-on: https://dart-review.googlesource.com/68080
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-07 06:45:57 +00:00
Konstantin Shcheglov 737e546939 Resolve invalid return from constructor.
Change-Id: Ibec6d4e307b22fedb78a72531c852480a61cd8eb
Reviewed-on: https://dart-review.googlesource.com/68501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-07 02:45:08 +00:00
Konstantin Shcheglov 77202bf2b0 Resolve invalid 'as' constant expression.
Change-Id: I4d9463fe60a47ec2dc44d5da30d4923b20244e45
Reviewed-on: https://dart-review.googlesource.com/68428
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 21:12:06 +00:00
Konstantin Shcheglov cec29e4aa8 Infer original expression in SyntheticExpressionJudgment.
Change-Id: I91a27d06ccf4197274fc96597d384ba4e2335dbd
Reviewed-on: https://dart-review.googlesource.com/68426
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 21:04:22 +00:00
Konstantin Shcheglov 8df84c0a00 Store resolution for out of range integer literals.
R=brianwilkerson@google.com

Change-Id: Ice783c3fc279bfd34a5aeebf4e9e9f5f014c000b
Reviewed-on: https://dart-review.googlesource.com/68423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-03 20:32:38 +00:00
Dmitry Stefantsov cda3659f7f [fasta] Handle annotations on formals of typedefs
Fixes #33799.

Bug: http://dartbug.com/33799
Change-Id: I5808e45839cece468d890dcaf344df0d4b249a3c
Reviewed-on: https://dart-review.googlesource.com/65701
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-08-03 14:29:30 +00:00
Dmitry Stefantsov 637e55d4be [kernel] Add VariableDeclarations to represent formals of Typedefs
Change-Id: Ic1575dadb4fcf644dfdeb436612e2bed72d41a03
Reviewed-on: https://dart-review.googlesource.com/68083
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-08-03 12:28:11 +00:00
Konstantin Shcheglov 62a2752b96 Translate ConstructorElement(s) of parameterized InterfaceType(s) to ConstructorMember(s).
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I865a2e96f691d827165eabf382b5677d0831e831
Bug: https://github.com/dart-lang/sdk/issues/33506
Reviewed-on: https://dart-review.googlesource.com/68161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-08-02 22:14:59 +00:00
Konstantin Shcheglov 4bb3fb6cae Don't rewrite error Severity for special cases of front-end testing.
IIUC this rewriting was done to internally check front-end better, but
it get in the way of running analyzer, and these errors are not mandated
by the spec. So, I decided that I don't want doing rewriting in
Analyzer / CFE integration.

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

Bug: https://github.com/dart-lang/sdk/issues/34042
Change-Id: I1bb41b271d8d84eace9bd13a269bcac157e9f89b
Reviewed-on: https://dart-review.googlesource.com/68006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-02 15:41:12 +00:00
Jens Johansen 26e087e66b Don't save Tokens in Judgments
Before this CL, Judgments save Tokens in final fields.
This can take up quite a lot of space, and isn't actually (currently)
used for anything. Eventually it will be used in Analyzer.

This CL changes it so Judgments instead carry a `box` that is in
`non-analyzer-mode` just null, and in `analyzer mode` stores the Tokens
directly.

When running dart2js through the VM, this decreases the memory footprint
quite a lot, and seems to make the compile faster.

Details:

Removing the Tokens decrease the memory usage by almost 50MB
("Maximum resident set size" (as reported by /usr/bin/time -v)),
and more than 66MB from the old space in the kernel isolate after
ended compilation and changed the compile time of dart2js by
-7.71201% +/- 6.22211% (presumably because of less pressure on the GC).

For more details see the review page comments.

Change-Id: I7a31927f104e111c1b16be10b35f4164959a2130
Reviewed-on: https://dart-review.googlesource.com/67720
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-08-02 12:44:02 +00:00
Jens Johansen 4c75b49b3f Clear Token in field builder after use
When compiling dart2js this cuts down the old generation
(after forced GC, VM kernel isolate) from ~230 MB to ~217 MB.

Change-Id: Id06a2666d1849e49acc18c4142ab346f581e5b23
Reviewed-on: https://dart-review.googlesource.com/67520
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-08-02 12:44:02 +00:00
Konstantin Shcheglov 4b07df24dd Store invalid deferred types used in bodies.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Id9f6309b5a9af69d38305c538bacb967c4565793
Reviewed-on: https://dart-review.googlesource.com/67688
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-01 00:54:09 +00:00
Konstantin Shcheglov 12326c10e1 Store constructor field initializera when the target is not a field.
Change-Id: Ie96f337272cc15d98515b9ce52210cf9414bad65
Reviewed-on: https://dart-review.googlesource.com/67680
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-07-31 22:15:03 +00:00
danrubel 4b2ee8e9a5 Improve catch clause recovery
Fix https://github.com/dart-lang/sdk/issues/33982

Change-Id: I98387ffabef87dd0296f18e080a1c4b8a7e97c2b
Reviewed-on: https://dart-review.googlesource.com/67641
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-31 20:30:03 +00:00
danrubel 4734c55882 Report error on unsupported operators
Change-Id: Iea1469e1252c89c630e8bf646caf37051d78c84c
Reviewed-on: https://dart-review.googlesource.com/67401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-07-31 18:23:10 +00:00
danrubel ff9167ff7b Fix parseDirectives to recognize metadata
Change-Id: I36be5c3ffef93c0bb6ae58b8c482df4208a37e63
Reviewed-on: https://dart-review.googlesource.com/67440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-07-31 16:46:38 +00:00
Kevin Millikin 8c5aca7d4d Remove the Factory interface
It's currently just passed around and never used, so remove it for
now.  We will (obviously) restore it when and if we need it.

Change-Id: Ie47243f73d74190c2acf4c6f83eb2fa6f60702fd
Reviewed-on: https://dart-review.googlesource.com/67560
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-07-31 14:43:00 +00:00
Konstantin Shcheglov 6c39bc38f3 Clear ShadowX references that are not required after compilation.
This is the second CL that helps to prevent memory leak in Analyzer / CFE
incremental compilation.

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

Bug: https://github.com/dart-lang/sdk/issues/33851
Change-Id: I140e7efa7509ecea23ff4541b0566ac3fc465f76
Reviewed-on: https://dart-review.googlesource.com/67384
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-07-30 21:40:34 +00:00
Konstantin Shcheglov 9fb6c09015 Store reference/type for invalid types.
This fixes 18 language_2 tests.

Small degradation in Analyzer unit tests is cause by the way we apply
Kernel type to Analyzer type annotations in DeclarationResolver. We
should shift this logic to using store type resolution instead.

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

Change-Id: I2d60201ec4f4a741bba3f86f65d8dc3b6547514c
Reviewed-on: https://dart-review.googlesource.com/67260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-07-30 17:49:55 +00:00
danrubel 238bffec02 Report error on illegal initializer
Change-Id: If1485b20c8be2370100709baeb3b735a723fc265
Reviewed-on: https://dart-review.googlesource.com/67180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-07-27 20:35:19 +00:00
Brian Wilkerson 56bd1fc6f7 Remove two more deprecated_ methods from BodyBuilder
Change-Id: I89597436a45c937a735e0a511972237a1cfc2378
Reviewed-on: https://dart-review.googlesource.com/67201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-27 19:33:00 +00:00
Konstantin Shcheglov 82947cccc9 Store named types resolution during outline building.
It fixes 8 tests, and opens a way to fix more.

It also "breaks" 4 tests, but only because we now check more rigorously.
Specifically - tests that check wrong number of type arguments and cycles.
This is something I will improve later.


Change-Id: I4a3bcd4ff56831f597fd02224bda032b7a0fadb9
Reviewed-on: https://dart-review.googlesource.com/66920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-07-27 18:43:20 +00:00
Paul Berry 31af5ce13c Revert CLs reworking generator class handling of non-lvalues.
This arc of work is breaking the Flutter roll--see
https://github.com/dart-lang/sdk/issues/33993.

This reverts the following commits:

- 55c0857037 (Create a common generator class to handle non-lvalues.)

- c9b197017c (Rename "assignment_of" -> "assignment_to".)

- 32fd7b15e4 (Remove special case for assignment to parenthesized
  expressions.)

- 432e59e589 (Fix error reporting if a for-in statement attempts to
  assign to a prefix.)

- 232bed3d11 (Change UnresolvedNameGenerator to use
  NonLvalueGenerator.)

- 0b778d0697 (Change IncompleteErrorGenerator to make use of
  NonLValueGenerator.)

- 1a5f94a0a4 (Fix analyzer-CFE integration of illegal references to
  instance members from static contexts.)

Change-Id: Id637e5ec60150a73031c05d7bb4c6effefd2aa8a
Reviewed-on: https://dart-review.googlesource.com/67091
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-07-27 17:18:28 +00:00