Commit Graph

52 Commits

Author SHA1 Message Date
Mike Fairhurst 9727a4a4ef 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>
2018-07-24 19:31:57 +00:00
Brian Wilkerson 129dc3c984 Update the failing tests in StaticWarningCodeTest_Kernel
Change-Id: Iee593dfa0207299270e1af13840063336c038292
Reviewed-on: https://dart-review.googlesource.com/66341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-24 13:19:24 +00:00
Konstantin Shcheglov ca947ffc1c Store resolution for invalid elements used as types.
Change-Id: I4824d629ad75f6a10d26af69817140b721cc8a78
Reviewed-on: https://dart-review.googlesource.com/65982
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-07-23 22:05:19 +00:00
Brian Wilkerson c0c23dcd6f Start updating test expectations for tests that are now passing
Change-Id: I21838954bc74e7b714552a89983d1d76073def09
Reviewed-on: https://dart-review.googlesource.com/65941
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-07-20 16:43:46 +00:00
Brian Wilkerson 14b359fdb9 Map VoidExpression to an analyzer code
Change-Id: I18274a543b486ad874dd95d5dc7a16ecadb801d7
Reviewed-on: https://dart-review.googlesource.com/65563
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-18 16:30:20 +00:00
Paul Berry 7b964090b9 Adapt ResolutionApplier.visitFormalParameterList to handle function-typed formal parameters.
Fixes #33845.

Change-Id: I6de918d644e9a22b1a9f9cd384b972047078a472
Reviewed-on: https://dart-review.googlesource.com/65162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-07-16 18:07:48 +00:00
Paul Berry 823835c84b Fix analyzer/FE integration of references to class type parameters.
Fixes #33844.

Change-Id: Id73a9af39a7fa699b71ed8825dfd16c3aa90b877
Reviewed-on: https://dart-review.googlesource.com/64981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-07-14 00:22:59 +00:00
Paul Berry ae0a4d994e Rework how type information is communicated from CFE to analyzer.
This CL introduces new Factory/TypeInferenceListener methods to
communicate details about types that are literally named in the source
code.

Previously, when an expression like `x as List<int>` was analyzed, the
resolution information about `List<int>` was communicated to the
analyzer via a kernel DartType, forcing the analyzer to walk the type
representation, applying each of its constituent parts to the
corresponding part of the AST for `List<int>`.  This was a lot of work
for the analyzer, it failed to resolve parts of invalid types (such as
`List<int, String>), and it didn't pave the way toward moving to the
Factory API.

The new approach is for information about each type appearing in the
syntax to be communicated to the analyzer at the time the BodyBuilder
converts it to a DartType.  So for an invalid type like `List<int,
String>`, the resolution of `String` is communicated to the analyzer
at the time it is converted to a DartType; later, when `String` is
discarded (because `List` only accepts one type parameter), no crucial
information is lost, because the analyzer already knows the resolution
of `String`.

Work still to be done has been captured in issues:
- #33844: References to type parameter elements are not translated
- #33845: Function typed formal parameters are not handled
- #33846: Function types using `Function` syntax are not yet handled

Change-Id: I96dd9b6f3eb573b0b7a46335e8644c59fb78bae7
Reviewed-on: https://dart-review.googlesource.com/64262
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-07-13 23:15:29 +00:00
Brian Wilkerson d5c7f5af88 Convert more Unspecified errors to concrete errors
Change-Id: Ia72c33e3258472aa8d17ff24c58c8cf63483b823
Reviewed-on: https://dart-review.googlesource.com/64803
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-13 22:55:22 +00:00
Konstantin Shcheglov 1c95390082 Store resolution for final fields that initialized multiple times.
Change-Id: Iee57f4540ad2ffeb66498f061f0cca77e53320ab
Reviewed-on: https://dart-review.googlesource.com/64661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-07-12 17:41:28 +00:00
Konstantin Shcheglov 25969b2af3 Store resolution for abstract class constructor invocation.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I8973a93550cb7718070a478c26747c88176f60f7
Reviewed-on: https://dart-review.googlesource.com/64160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-07-09 19:11:14 +00:00
Paul Berry 973f73b150 Handle invalid types from front end.
Change-Id: Ib5e1d73c61303a567961dadac8f324746e21dbed
Reviewed-on: https://dart-review.googlesource.com/63687
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-09 18:32:18 +00:00
Brian Wilkerson ed0ccc7ac9 Add more error message mappings
Change-Id: I5511ba2404ca3a430c6fda35b5e79a14eceb1188
Reviewed-on: https://dart-review.googlesource.com/63961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-09 16:38:08 +00:00
Brian Wilkerson f0560a8d66 Add error code ArgumentTypeNotAssignable to improve messaging (issue 33712)
Change-Id: I9a6e039efdf396f838ae99926877658f5570e380
Reviewed-on: https://dart-review.googlesource.com/63960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-09 16:35:48 +00:00
Dmitry Stefantsov aa6dc1e2d5 [fasta] Resolve redirecting factories invocations after bodies are built
Fixes #32130

Bug: http://dartbug.com/32130
Change-Id: I6773bdf71de3887911daa42bd6ea5bf16052cf35
Reviewed-on: https://dart-review.googlesource.com/63826
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-07-06 09:06:56 +00:00
Paul Berry 45eee81252 Check another case of StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC.
The analyzer was missing cases where the reference to the type
parameter was in an ordinary SimpleIdentifier, not part of a TypeName.

Fixes #21565.

Change-Id: I6be21b296c8c60777238c89a4e5e15a8c0ca8a6e
Reviewed-on: https://dart-review.googlesource.com/63660
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-03 19:58:31 +00:00
Brian Wilkerson 4c789e9c09 Support the instantiation of abstract constructors
Change-Id: Icc9a06dce056c9ca12bcf5b8c82593c72e9ccd2c
Reviewed-on: https://dart-review.googlesource.com/63480
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-07-03 19:53:54 +00:00
Brian Wilkerson 53525542cd Add tests for instance create of an abstract generic class
Change-Id: I040f30ed75e67fca0ef1bb1300d2a77bc27e417c
Reviewed-on: https://dart-review.googlesource.com/63520
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-07-03 17:42:15 +00:00
Dmitry Stefantsov 22b9847cca [analyzer][cfe] Don't crash on converting errors with Severity.context
Change-Id: I70760dc2c1bc2f6a0b4bbec6887ebfac0b1f3172
Reviewed-on: https://dart-review.googlesource.com/63400
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-07-03 11:32:16 +00:00
Paul Berry b8a70f0471 Analyzer/FE integration of unresolved static method calls.
Change-Id: Ia1e1e29d5b00c8adc6cc34e08158757fc6812759
Reviewed-on: https://dart-review.googlesource.com/63445
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-07-02 19:56:53 +00:00
Brian Wilkerson 3be6fdb219 Convert more error codes
Change-Id: I7ee8040d99f8047a1ccdd2bdf217b32f36409ba9
Reviewed-on: https://dart-review.googlesource.com/63363
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-07-02 17:43:13 +00:00
Konstantin Shcheglov f385664e4b Store unresolved assignments as UnresolvedVariableAssignmentJudgment.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I4738ba450b1f7e7cab794bdc34a88996d1d827b3
Reviewed-on: https://dart-review.googlesource.com/63360
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-02 17:14:28 +00:00
Konstantin Shcheglov 201fb2833c Don't report duplicate errors when CFE already reports them.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/33674
Change-Id: Ia8e0ef74e333fbd99f615aa87629ca20de08af07
Reviewed-on: https://dart-review.googlesource.com/63362
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-01 22:43:05 +00:00
Konstantin Shcheglov 636dfc05c6 Record unresolved identifiers as UnresolvedVariableGetJudgment.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I7a4a09d7f83cb6a2441037d37ee080bd113a3ab0
Reviewed-on: https://dart-review.googlesource.com/63265
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-06-30 02:03:11 +00:00
Konstantin Shcheglov cf4313c14e Throw exception if CompilationMessage cannot be translated to a Analyzer ErrorCode.
Fixes some of the new failures in unit tests.

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

Change-Id: I39d132fa6c71dd8e5a492ed8dbcbea4cb6c0dac6
Reviewed-on: https://dart-review.googlesource.com/62960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-06-29 00:13:08 +00:00
Paul Berry 591cf85c76 Re-enable the old analyzer/FE integration logic.
This gets the tests running again.  I'll follow this up with CLs that
reshape the ResolutionStorer API to match the Factory API we're
building, and then after that we can transition the code over to
calling the Factory API directly.

Fixes #33504
Fixes #32258

Change-Id: I105841ed5b2ed1198ec5e3e7387f694c61d36ca7
Reviewed-on: https://dart-review.googlesource.com/61101
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-06-20 14:35:31 +00:00
Kevin Millikin be30b62e3d Remove the Kernel type inference listener
We have decided to move to a different API for Fasta/Analyzer
integration, one that doesn't involve compiling to Kernel or observing
type inference.  The listener API will become broken, so let's just
remove it before that happens.

We lose the ability to trace type inference so let's restore that
ability next.  The analyzer's resolution storer is not used, but that
code has been left.  The resolution applier will no longer work
without the resolution storer, so those tests have been disabled.

Change-Id: If9ac5aba2d5de7788d8a65f7fa8410599e636d21
Reviewed-on: https://dart-review.googlesource.com/42400
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-21 16:28:07 +00:00
Mike Fairhurst e9c5abdaca Remove @override for test method that was renamed & now passes to fix build
Change-Id: I69138be190092681d4bdf1d06936f06a9a1bddab
Reviewed-on: https://dart-review.googlesource.com/40621
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-12 22:30:12 +00:00
Mike Fairhurst cc6b4219a5 Remove more methods I somehow missed that I needed to remove
Change-Id: I528b8a74db0c13e7868f79e5584712c317b01f3d
Reviewed-on: https://dart-review.googlesource.com/40105
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-08 23:06:32 +00:00
Mike Fairhurst 56d59dd967 Reland https://dart-review.googlesource.com/c/sdk/+/37441 with fixes
Change-Id: If8e2ec2ca1ac4f533dcb56b0c95d55e4a13e0598
Reviewed-on: https://dart-review.googlesource.com/39881
Reviewed-by: Paul Berry <paulberry@google.com>
2018-02-08 20:46:19 +00:00
Mike Fairhurst ec58f5646a Revert "Make void a static warning to use almost everywhere."
This reverts commit 09eed74a8a.

Reason for revert: Too much SDK code is not yet compliant.

Original change's description:
> Make `void` a static warning to use almost everywhere.
> 
> Changed the hint to a StaticWarningCode, since that's the new spec'd
> error type and the hint is no longer needed.
> 
> Added a new set of methods to test the cases.
> 
> Didn't try to solve the problem generally ("all usages except ... are
> errors" means it easier, in theory, to make a ReportVoidExpressions
> style visitor that catches absolutely all types) because most of the
> work is actually about suppressing errors that are no longer needed.
> Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
> put the void handling logic into each AST method specially anyway.
> 
> Some redundant tests removed.
> 
> Don't flag: ternaries, void -> void assignments, void returns in
> dynamic.
> 
> Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
> Reviewed-on: https://dart-review.googlesource.com/37441
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=leafp@google.com,scheglov@google.com,mfairhurst@google.com

Change-Id: I13ee4c6939468d35506779ade637a040833632f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39848
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-07 22:32:51 +00:00
Mike Fairhurst 09eed74a8a Make void a static warning to use almost everywhere.
Changed the hint to a StaticWarningCode, since that's the new spec'd
error type and the hint is no longer needed.

Added a new set of methods to test the cases.

Didn't try to solve the problem generally ("all usages except ... are
errors" means it easier, in theory, to make a ReportVoidExpressions
style visitor that catches absolutely all types) because most of the
work is actually about suppressing errors that are no longer needed.
Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
put the void handling logic into each AST method specially anyway.

Some redundant tests removed.

Don't flag: ternaries, void -> void assignments, void returns in
dynamic.

Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
Reviewed-on: https://dart-review.googlesource.com/37441
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-07 21:36:01 +00:00
Sigmund Cherem f541f060ee [fe] deferred access checks for several access patterns of classes.
This adds checks for allocations and type values, and provides a compile
time error for type declarations, is-checks, and as-casts.

Change-Id: I3bfed41b0dd45abeb02158f0537102c779511998
Reviewed-on: https://dart-review.googlesource.com/36383
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-02 20:44:16 +00:00
Brian Wilkerson b74ceb0248 Remove a warning (issue 31351)
Change-Id: Id798aa7ece345970e3bfba15b260df6482a57074
Reviewed-on: https://dart-review.googlesource.com/37861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-31 20:42:26 +00:00
Paul Berry 314b89e11d Update the analyzer to require noSuchMethod overrides to be concrete.
See 38dcb10543 for details.

Change-Id: I00608f7106e1b37cde81b8145d8d748f8cd97804
Reviewed-on: https://dart-review.googlesource.com/36520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-24 13:55:18 +00:00
Jaime Wren cd878bc433 Create the new flag --use-cfe in the analyzer, analysis server and analyzer_cli and migrate the old behavior of --preview-dart-2 to --use-cfe. The --preview-dart-2 flag is now a no-op, with functionality coming soon.
See https://github.com/dart-lang/sdk/issues/31640

Change-Id: I2db2e7ef6a324cbd5d369b807e331495fed167df
Reviewed-on: https://dart-review.googlesource.com/33121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2018-01-08 22:37:05 +00:00
Konstantin Shcheglov 76c5a9a6c8 Convert errors from FrontEnd into Analyzer.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I94f219e378437e0bcff3ee8e2ca0598594e59afc
Reviewed-on: https://dart-review.googlesource.com/32143
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-03 20:05:25 +00:00
Leaf Petersen 53908b0790 Remove warning for "is" checks with generic type parameters.
The analyzer used to emit a warning when a type parameter to a generic
method was used in an "is" check.  This warning was there to help
users write code that worked correctly on both Dart 1.0 and 2.0.  Now
that 2.0 generic methods are being more broadly supported and used,
this warning is blocking further library work, and is being removed.

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

Bug:
Change-Id: I70395305ad082aee3072b5beeb0b1b7f7883391b
Reviewed-on: https://dart-review.googlesource.com/29821
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-15 18:12:03 +00:00
Sam Rawlins ee07335392 Improve message around re-assigning a local final.
Add a new ASSIGNMENT_TO_LOCAL_FINAL code for the new text.

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

Bug: https://github.com/dart-lang/sdk/issues/28721
Change-Id: I5492dd0d9ee09d5b73296b46fe10271661c3c64f
Reviewed-on: https://dart-review.googlesource.com/29621
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-15 01:09:55 +00:00
Mike Fairhurst 62e5c677a8 Enable previewDart2 in static warning code kernel tests. Others passing.
Enable previewDart2 and annotate all @potentialAnalyzerProblems.

Also fix two of the @failingTests related to
https://github.com/dart-lang/sdk/issues/31073 which appear to be
passing now.
Bug:
Change-Id: Ic2fd534c8a9cf45eccf0f5d09dc47cd4e78aaf42
Reviewed-on: https://dart-review.googlesource.com/27468
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2017-12-08 18:31:58 +00:00
Konstantin Shcheglov bd49ff15bf Record constructor name offset in metadata.
This fixes 70 Analyzer tests.

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

Bug:
Change-Id: If7e3fa948aa67712eab5533b083757a75a981e14
Reviewed-on: https://dart-review.googlesource.com/13926
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-16 18:29:37 +00:00
Konstantin Shcheglov afaf47e29b Triage the rest of StaticWarningCodeTest_Kernel as Fasta problems.
Unfortunately there are nothing we can fix at the Analyzer side yet.

R=brianwilkerson@google.com

Bug:
Change-Id: I859f8608833fcdf254bf811906475ffec871665c
Reviewed-on: https://dart-review.googlesource.com/13241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-11 18:32:50 +00:00
Konstantin Shcheglov 4c6322ac16 Triage StaticWarningCodeTest_Kernel and fix one problem.
R=brianwilkerson@google.com

Bug:
Change-Id: I26d1f30fca0928d1ec00bfba932975734a1c1b7a
Reviewed-on: https://dart-review.googlesource.com/13181
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-11 18:00:25 +00:00
Konstantin Shcheglov 7d9188aea1 Add FallThroughError that is used by Fasta.
R=brianwilkerson@google.com

Bug:
Change-Id: Iff5a981f7ce9e9693996bc18493c13b2d88e5f6d
Reviewed-on: https://dart-review.googlesource.com/12782
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-10-11 02:02:40 +00:00
Konstantin Shcheglov b7d00a8712 Add _DuplicatedFieldInitializerError that is used by Fasta to report compilation errors in Kernel.
R=brianwilkerson@google.com

Bug:
Change-Id: I27ef95ecb53a37fa1543fd65e3a6ea09974f3b56
Reviewed-on: https://dart-review.googlesource.com/10840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-04 16:24:52 +00:00
Konstantin Shcheglov 8d0c0bae0b Triage tests failing because of import/export and duplicate declarations.
R=brianwilkerson@google.com

Bug:
Change-Id: I771c33de3f719483d65b8415f4ce61e4335cd84e
Reviewed-on: https://dart-review.googlesource.com/10162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-02 20:56:02 +00:00
Konstantin Shcheglov e8fe137e94 Remove ExecutableElement.functions and don't resynthesize local functions.
As for all other local elements - variables and labels, we now
created them when we analyze the unit, but we don't export them
through the element model.

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

Bug:
Change-Id: I71eb567f58d6d710fc8a58d1653a66d95ef1ddcd
Reviewed-on: https://dart-review.googlesource.com/9861
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-01 21:08:04 +00:00
Konstantin Shcheglov b5fc2de3bf Keep sources for libraries of the current cycle.
This should fix the issue 30917 flakiness.

The reason why the tests were failing is that the code in the tests
was not quite correct Dart code, so Fasta generated a synthetic
`#errors` top-level variable with fileUri == null. We should skip
this field because it is not a part of any unit, because its fileUri
is not the fileUri of any unit.

But we lose fileUri for a Node if Program.uriToSource does not
include this URI. So, if we clear uriToSource in KernelDriver, we
lose all the file URIs. So, now we keep sources for the cycle files.

The reason for flakiness is because of the same race condition
between analyzing AnalysisDriver.addFile() and getResult(). If
we process getResult() before, we don't have to read the library
kernel file, we just create in first time, and fileUri(s) are
valid.

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

Bug: https://github.com/dart-lang/sdk/issues/30917
Change-Id: Ie559cf2a8a778ebf4a9e297f5cb13d30a98b5a3c
Reviewed-on: https://dart-review.googlesource.com/9744
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-09-29 18:38:52 +00:00
Konstantin Shcheglov c6ba28a5a8 Create (empty) initializers for parameters resynthesized from Kernel.
R=brianwilkerson@google.com

Bug:
Change-Id: I1fc4d7db27951fb0e094dc685eb3e0bde4663e68
Reviewed-on: https://dart-review.googlesource.com/8162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-25 17:13:18 +00:00
Konstantin Shcheglov f575c099b0 Run all *_driver tests also with Kernel. (attempt #2)
With previous changes that fix finding dart:core on Windows and
flakyness of reporting import errors, I'd like to reland this CL.

Attempt #1: https://dart-review.googlesource.com/c/sdk/+/7624

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

Bug:
Change-Id: If5ab2c5ebe2204df6643ee42cbee5b49fb2d8c31
Reviewed-on: https://dart-review.googlesource.com/7961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-24 18:27:27 +00:00