Commit Graph

43 Commits

Author SHA1 Message Date
Konstantin Shcheglov fc91636703 Fix for crash when FieldFormalParameter in a local function has annotations.
Saw this in the crash reports.

R=brianwilkerson@google.com

Change-Id: I890592b264a3c33df80d89b45ad55ebe3fdf0c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-26 17:07:03 +00:00
Konstantin Shcheglov cdac6f614c Issue 40837. Fix for invalid function expression flow analysis.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/40837
Change-Id: Id7021aa6b54fede6af2d03f51fd1d53445d174c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139149
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-12 15:33:02 +00:00
Konstantin Shcheglov 5bfabfb4f0 Merge some resolution assertions.
Change-Id: I4a5d79d13d890acd641f302c85c7b0f463a11200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-01-08 17:30:35 +00:00
Konstantin Shcheglov 3e961f4e91 Stop using assertHasTestErrors() where possible.
R=brianwilkerson@google.com

Change-Id: I0ab8d2afd27c3a18d4fd49cb0e3864078cc163ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130121
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-03 16:12:49 +00:00
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00
Konstantin Shcheglov 7df44023f4 Issue 38878. Update SuperContext for annotations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38878
Change-Id: Ib2944fd60062fca0ec2899d83656cdc02b0a4a87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125529
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 19:06:48 +00:00
Konstantin Shcheglov b5b45ffe4b Issue 38953. Exit the unit element walker on enter into a directive.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38953
Change-Id: I54e84e28f5d576bcd50c8bb10e99aefdae725c25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125528
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-11-18 18:11:53 +00:00
Konstantin Shcheglov aa0cf44b05 Issue 38506. Don't attempt to use LibraryElement.metadata for not the first LibraryDirective.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38506
Change-Id: Ib76b1e81554f061622ec98fae21b4dd9a1280c24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-18 15:28:45 +00:00
Konstantin Shcheglov a8e48405dd Share search methods in FindElement and ImportFindElement.
Change-Id: I511c23440fbd95b3a27a50d7b80c66c9a8a7f558
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125125
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-13 22:22:25 +00:00
Konstantin Shcheglov decca61f8c Deprecate TypeDefiningElement.type except ExecutableElement.
Change-Id: I7888f7ff796f1c4523cdc7030451dfc3ab622970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122729
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-31 05:09:13 +00:00
Konstantin Shcheglov 8c3065e947 Add fuzz tests for annotation resolution crashes.
Change-Id: I2748ae2bee93b621f864c11dc4d58ec9b1e4b9fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-10-01 21:50:20 +00:00
Konstantin Shcheglov 595022bdea Remove summary1, part 1.
Change-Id: I557785ac13fa411280ce032324b0305bf25a0a6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119170
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-28 14:30:05 +00:00
Konstantin Shcheglov bf361ebe19 Replace addTestFile()/resolveTestFile() pair with resolveTestCode().
R=brianwilkerson@google.com

Change-Id: Ie3289e355421b0339b012319ce39d2b8eb9569d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-25 16:03:16 +00:00
danrubel 000de948fa add test for 38091
Fixed by earlier parser recovery improvement.

Fix https://github.com/dart-lang/sdk/issues/38091

Change-Id: I9fa4c3870965c1f03bae9f11da6eaf1e65bfabf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115904
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-09-19 16:56:50 +00:00
Mike Fairhurst 330fccbc0d Implement extension override in summary2
Change-Id: I0c7028eaa53ae070d521cda86a885435e4345089
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117124
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-09-13 21:23:03 +00:00
danrubel b6f6240013 fix extension factory declaration in AST
Constructor declarations within extensions are invalid and the parser
reports an error. This modifies AstBuilder to add the declaration
as a method declaration in order to get navigation, search, etc.

Fix https://github.com/dart-lang/sdk/issues/38202

Change-Id: I6071a8d5a742d6598f18a831688ddc97e411f76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-09 05:26:16 +00:00
Konstantin Shcheglov ffd50c0dc5 Report EXTENSION_AS_EXPRESSION, set type fo dynamic.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/38203
Change-Id: Iee270b7b3fecbeaba202c304f21ef703a8567674
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116055
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-06 22:14:34 +00:00
Konstantin Shcheglov 7835190cc9 Revert: Read default values fully.
This reverts https://dart-review.googlesource.com/c/sdk/+/114780,
because it causes other stack overflow while reading elements.

R=brianwilkerson@google.com

Change-Id: Id9e398bba984f364d4a1a8fcb76f71d7f39379af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-29 17:12:04 +00:00
Konstantin Shcheglov b565c8c20f Don't serialize not serializable constant variable initializers.
R=brianwilkerson@google.com

Change-Id: If5287b11293391d8620b9843880b95f725efc5fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-28 22:28:56 +00:00
Konstantin Shcheglov cb934a0402 Build types for function type type parameter bounds.
R=brianwilkerson@google.com

Change-Id: Ied38fda4d1671a9e706bffe8bcf16d953c8c973e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-28 15:57:23 +00:00
Konstantin Shcheglov 0c06fbd88f Read default values fully.
R=brianwilkerson@google.com

Change-Id: I336fa6a9d92687ebcb67eb672dabab64f75fcb43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-28 15:15:23 +00:00
Konstantin Shcheglov 3604f75cd4 Gracefully degrade if annotation uses (non-serializable) FunctionExpression.
R=brianwilkerson@google.com

Change-Id: Id0e18d14252a4140f085e1c609e59ef9ae40fb5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-27 20:47:57 +00:00
Konstantin Shcheglov 35f8a8bf00 Gracefully degrade when FunctionTypeAlias uses FieldFormalParameter.
R=brianwilkerson@google.com

Change-Id: Ie2989000148b24f5c380043bbd7c034908f2846d
Bug: https://github.com/dart-lang/sdk/issues/37733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-27 17:46:48 +00:00
Konstantin Shcheglov e7f82cdb7c Support for FunctionTypedFormalParameter in GenericFunctionType.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/37733
Change-Id: If335fcabd354a4a33c6177ae149aebcb31b4a0b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114120
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-22 21:19:00 +00:00
Konstantin Shcheglov 9aa48c2e91 Build local elements in initializers of typed constants.
R=brianwilkerson@google.com

Change-Id: I7e7c75841b50ca91132278244cb71a6f7aa3649c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113963
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-21 17:07:22 +00:00
Konstantin Shcheglov 64efe44e5e Formal parameters of FunctionTypeAlias should be created in @function reference.
R=brianwilkerson@google.com

Change-Id: I9f0a4f385d714644b07313752ba0d4643673fc0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113961
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-21 16:15:31 +00:00
Konstantin Shcheglov f50a566476 Enclose local variables in default values of optional formal parameters.
R=brianwilkerson@google.com

Change-Id: I693759f24cab6a63d5a1ecbdb131324b29fc8d34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113927
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-21 00:41:24 +00:00
Dan Rubel 3568f78fe7 ensure super constructor invocation param list not null during recovery
Fix https://github.com/dart-lang/sdk/issues/37735

Change-Id: I727cd7aeb141c5abb779b3c15f338f3d43f6541f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-08-19 18:34:32 +00:00
Dan Rubel bdd77cd0b2 Ensure function type param has non-null identifier
Fix https://github.com/dart-lang/sdk/issues/37733

Change-Id: I552d67aa048eeb5ae4417205f641d71ca7ecadd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-19 17:46:47 +00:00
Mike Fairhurst 0477f8df9e Fix keyword infinite loop
Change-Id: I92bee9991400c229bbf665414a096efae72c14c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113126
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-08-16 20:08:30 +00:00
Konstantin Shcheglov 28a4717476 Don't overwrite synthetic field setter with duplicate setter.
R=brianwilkerson@google.com

Change-Id: I006b6e845b5359d02f0f60b48bf89544b2ed80c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111966
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-05 18:02:41 +00:00
Konstantin Shcheglov ae2a06171c Fix for enclosingElement for default parameter element initializer function.
This fixes another error found by Mike's fuzzer.

R=brianwilkerson@google.com

Change-Id: Id16a280949d14ce7589d47a88faf9a038c588e04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-05 16:45:17 +00:00
Konstantin Shcheglov 919b5cd2d5 Fix for duplicate top-level declarations.
This fixes one of the errors which Mike found with fuzz tester.

R=brianwilkerson@google.com

Change-Id: I987f47746c8721d9a39de0c186cf4c3776f66611
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111960
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-08-05 14:29:55 +00:00
Konstantin Shcheglov 770675b668 Fix for naming constructor with missing name.
R=brianwilkerson@google.com

Change-Id: I89ef01033c9e14417286e5ea95d2d88e1c498982
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106425
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-18 03:43:38 +00:00
Paul Berry 780f1b6c3e Remove unused imports
Change-Id: Ia34e9d49e1baffe96a7da72a663f6751de31fc36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100041
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-22 13:29:19 +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
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 4a7556840f Rename tests ending with Test_Driver
Change-Id: I1b4822630a2508e8a41ba6c5564eae5a54f56622
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-13 13:38:22 +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
Brian Wilkerson cb61275708 Remove remaining uses of Null as a type argument from analyzer
Change-Id: I6022fbc18c002447278ec8dc0e2b24d3eb369a49
Reviewed-on: https://dart-review.googlesource.com/c/88436
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-05 19:26:07 +00:00
Devon Carew 2dd33c2a6c Have the package:analyzer strong mode option hard coded to on. Delete several spec mode only tests.
Change-Id: I5dffec68d9845fe75936d55100c03306b6eda363
Reviewed-on: https://dart-review.googlesource.com/64060
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-07-10 05:30:10 +00:00
Konstantin Shcheglov 670c288711 Issue 32162. Fix for crash in generic function type argument of unresolved class.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32162
Change-Id: I0a2df5bf5a08b52a7eb47e1b8265b9bbbf65e599
Reviewed-on: https://dart-review.googlesource.com/41922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 01:01:16 +00:00
Konstantin Shcheglov 9350925efe Add InvalidCodeTest with end-to-end cases of problematic invalid code.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I39d26ea0b333ddfa69f281eeba78b04212e95a96
Reviewed-on: https://dart-review.googlesource.com/17960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-11-01 18:16:25 +00:00