Commit Graph

34 Commits

Author SHA1 Message Date
Konstantin Shcheglov dd3d6547de Rewrite property resolution, fix reporting errors when compound assignment without a getter.
Change-Id: Id737ea776866c3d9a52033181759f27e26dc34b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116559
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-11 17:28:53 +00:00
Brian Wilkerson 233b4a71ca Deprecate some unnecessarily duplicated error codes
Originally the spec made a distinction between when some of these
conditions were errors and when they were warnings. That distinction has
been removed, so this just cleans up our code to reflect that fact.

Change-Id: I3a6fdae2896eb93c6b9cacfea790cd9b553feec5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115261
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-09-03 16:01:25 +00:00
Brian Wilkerson 5935b916e3 Rename several error codes and improve some messages
Change-Id: I6e629719dee14c2af7c1358145fb25b21f5d5157
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114160
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-08-22 20:08:53 +00:00
Sam Rawlins 5087b99361 Report final re-assignment in for-in parts. Fixes #30486
Change-Id: I299db3e1e301d90a1a2260d5574f7b174fc29d00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113580
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-19 23:24:22 +00:00
Konstantin Shcheglov 721ff350c0 Extract TYPE_ARGUMENT_NOT_MATCHING_BOUNDS tests.
R=brianwilkerson@google.com

Change-Id: Icea3c1d158d54a5d5d08e8727618f3558760615c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112752
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-12 20:12:05 +00:00
Konstantin Shcheglov 357f8b7155 Extract and augment DUPLICATE_DEFINITION tests.
R=brianwilkerson@google.com

Change-Id: Idbf6db69ea51ec784b3a8bf94586ea4d535252d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-10 20:57:45 +00:00
Konstantin Shcheglov e04dc4dd63 Update statuses and expectations with summary2 for some tests.
R=brianwilkerson@google.com

Change-Id: I48eeb07a5423bb35512b4b583a9b2a942cb2d83a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112043
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-06 17:42:39 +00:00
Konstantin Shcheglov c12deff784 Test that AMBIGUOUS_EXPORT is reported for extensions.
R=brianwilkerson@google.com

Change-Id: I5b89b6216d7f6d679f176cc9492407ab4bbdf77b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111262
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-30 16:03:09 +00:00
Mike Fairhurst 2f96be9ee3 [analyzer] Allow references of 'this' in late field initializers
Change-Id: Ic464a1d8402404ca79f2281780bf3d408bbb948a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110550
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-07-29 20:23:03 +00:00
Konstantin Shcheglov 6d55c7745f Revert a test expectation difference.
R=brianwilkerson@google.com

Change-Id: I8f5250db292eb03bd4b3244caf9bb98f53562af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-29 13:27:22 +00:00
Konstantin Shcheglov 8dc4148516 Add await to all assertErrors/assertNoErrorsInCode tests.
R=brianwilkerson@google.com

Change-Id: I5bf1b77ba5224ae5b250a3aa849c1e6da057ac3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-17 20:59:14 +00:00
Konstantin Shcheglov 4a56e6169e Update test expectation for enabled constant-update-2018
R=brianwilkerson@google.com

Change-Id: I059e7aa29a58c78fde9b8c62e6bd295ed841e297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-07-10 21:56:01 +00:00
Brian Wilkerson 588ab11ecc Unify two error codes that are essentially identical
The original reason for the difference is that one was used for run-time
exceptions that become static errors in constant evaluation, but that
distinction does not seem to be necessary any more.

Change-Id: Ie16ad623e292f9755cbe316755210097870a1515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-07-06 15:19:18 +00:00
Brian Wilkerson 6941d04a6e Add support for testing the context messages for diagnostics
Change-Id: I33d4abc0dcc969f3beecfdc7cbc814e8a486ad1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107142
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-24 18:15:38 +00:00
Mike Fairhurst c246fa1f2b Fix #36956, report undefined getter for uses on Null.
Bug: 36956
Change-Id: I5b8f40f5c1f7fd9304b02054e3d8d7d607c12af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106021
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-14 21:29:29 +00:00
Konstantin Shcheglov 13ff60ec02 Use Substitution for typeAfterSubstitution with summary2.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If8c4a4ad7db406fa4af9f22456ec40d153588db9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 15:33:17 +00:00
Lasse R.H. Nielsen eca6c8953f Allow async as an identifier everywhere.
Fixes #37063

Bug: http://dartbug.com/37063
Change-Id: I2253c3088fbe33eca1072f2480cf0cf3cc363362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-05-24 08:21:14 +00:00
Konstantin Shcheglov cf15dc17e0 With summary2 FunctionTypedFormalParameter has type parameters.
This re-applies changes to tests from https://dart-review.googlesource.com/c/sdk/+/100620

R=brianwilkerson@google.com

Change-Id: If6721d2febb39b52277fdb39845bb2486cb6eb47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-17 23:31:16 +00:00
Konstantin Shcheglov 42c35d7bd6 Optimize summary2.
1. Don't store tokens.
2. Start moving toward storing only semantic information.
3. Don't use DeclarationSplicer, DeclarationResolver.
4. GenericFunctionType(s) don't work, we need a way to associate AST
location to summary location. I think it is solvable.

Change-Id: If0bf9f20f8092068488322129853b788dd947eb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-11 15:49:39 +00:00
Konstantin Shcheglov de1966db11 Separately handle InterfaceType and FunctionType while collecting free type parameters.
FuntionType(s) with summary2 are not Element + typeArguments,
they are just types.

R=brianwilkerson@google.com

Change-Id: I52887e6b31cd4e2f9749ff67943159f3c93722fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100888
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-30 20:59:52 +00:00
Konstantin Shcheglov ea708965ab Find type alias self-references during linking.
Elements are not available for FunctionType(s), and during linking
we have the whole library cycle, so can compute self-references.

R=brianwilkerson@google.com

Change-Id: I2e145c4efae77ac5dbff2782f4b3590339187c0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100796
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-30 14:41:58 +00:00
Konstantin Shcheglov f598581e41 Support for type parameters in function typed formal parameters.
See also https://github.com/dart-lang/sdk/issues/28515

R=brianwilkerson@google.com

Change-Id: I4365a159a969b5cb77b755a9dad8602a9992ab7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-27 18:05:16 +00:00
Brian Wilkerson c3f822eae6 Attempt to fix failures on the windows bot
Change-Id: I668e62e5b866b83bba24a8406ffcaca4450eeb46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-21 19:42:17 +00:00
Brian Wilkerson 47a8ff60e1 Convert more analyzer unit tests
Change-Id: Ie457491e24bc8820d24c533342b0d74edb922370
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-21 15:29:17 +00:00
Paul Berry b6dbdfa62d Fix test in preparation for constant-update-2018.
This will prevent a spurious error when the flag is enabled.

Change-Id: I2f432844b5d41d7a13aff04644193341a5be69c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98942
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-09 15:03:33 +00:00
Brian Wilkerson 1b2a4b8eb1 Convert some tests to DriverResolutionTest
Change-Id: I0fdccb13b95b6e5047030ba084d4358c65a8e72f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98303
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-29 17:11:38 +00:00
Brian Wilkerson 0560014c79 Remove unused error codes
Change-Id: I47daa6dab610af657ca781db5ca88438988c3c87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-29 15:37:26 +00:00
Brian Wilkerson d0fda82493 Clean up some of the unused task model support in test code
Change-Id: I2a70070866e38377a4dd149b6407942e3f81c92d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98049
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-28 17:13:45 +00:00
Brian Wilkerson 4555cf788d Convert one more set of tests
Change-Id: I4854985bd475d95c17be83e648bf5716d6156fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98020
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-27 17:37:41 +00:00
Konstantin Shcheglov fa74184b7a Verify that constructor initializers use only potentially constant expressions.
...but don't evaluate them, because they don't have to be constants.

R=brianwilkerson@google.com

Change-Id: I5bc44a02947c1682da85c1f22b3fc28b52b13370
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97549
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-22 02:50:43 +00:00
Mike Fairhurst 337a252c31 [analyzer] UI as code test cleanup
Change-Id: I73300a2aa5cfa1a9043454e462ac1df2840ee308
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97271
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-03-19 22:00:29 +00:00
Mike Fairhurst 1bd7920367 Resolve generic function default parameter values
Change-Id: I060ee8f61b8cb74482b92d4057e4183f1e4ca269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96701
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
2019-03-13 22:44:18 +00:00
Konstantin Shcheglov f08e213bb1 Extract CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS tests.
R=brianwilkerson@google.com

Change-Id: Ic73cdade894f4d5832427d193eaa0c33e51676b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96825
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-13 19:28:34 +00:00
Paul Berry c9b1877cbf Disable task model for clients by making WorkItem inconstructible.
The task model is still allowed in analyzer tests since we still have
some unit tests of non-task-model functionality that rely on the task
model to do their testing (see #35734).

Unit tests whose sole purpose was to test the task model have been
removed.  Test files that now empty have been removed.  Non-empty test
files that now contain no tests of their own have had their `main`
functions removed, and have been renamed so that the testing
infrastructure will no longer attempt to run them.

Change-Id: I8b4d0b2dde9337c4e1fe91e443a2c9da6eee8f4f
Reviewed-on: https://dart-review.googlesource.com/c/90720
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-01-24 16:29:17 +00:00