Konstantin Shcheglov
242bc3413c
Copy @failingTest annotations to mixin applications.
...
This works around https://github.com/dart-lang/sdk/issues/33099
R=brianwilkerson@google.com
Change-Id: Idfada538b30fe6d8cce2d23112787522e5d19521
Reviewed-on: https://dart-review.googlesource.com/54705
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2018-05-11 18:31:00 +00:00
Brian Wilkerson
7a76db73d1
Add more parser tests for Fasta
...
Change-Id: I126f028ced01ac0624f080269a6a40d7de4a248d
Reviewed-on: https://dart-review.googlesource.com/54637
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Dan Rubel <danrubel@google.com >
2018-05-11 13:51:16 +00:00
Dan Rubel
7c8a4ae569
Refactor Analyzer/CFE body builder tests
...
Change-Id: Icbcd0e16fce448afe340598975d67154a5478df3
Reviewed-on: https://dart-review.googlesource.com/54601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-10 20:13:35 +00:00
Dan Rubel
04af8ace52
Improve top level const/final/var name recovery
...
Change-Id: Ie07ca020a5f5a6c3abbe2ee48bd83c4e3ea4075c
Reviewed-on: https://dart-review.googlesource.com/54600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-10 20:07:25 +00:00
Brian Wilkerson
f62b9781bc
Fix the resolution tests associated with simple literals
...
Change-Id: Id26eaaa368ea94c83031032b3ab8abdc6ba20d2d
Reviewed-on: https://dart-review.googlesource.com/54620
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Dan Rubel <danrubel@google.com >
2018-05-10 16:33:09 +00:00
Dan Rubel
17c50d45fa
Remove most uses of kernel.Expression
...
I'm landing Peter's change:
https://dart-review.googlesource.com/c/sdk/+/54460
Change-Id: I2228d0a0156f67e41515c41788c0b855f1a2a437
Reviewed-on: https://dart-review.googlesource.com/54544
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-05-10 14:55:50 +00:00
Brian Wilkerson
c2f807e487
Implement more overridden methods in parser tests
...
Change-Id: I981df7281ab33ada15672f6017a40f88fe3a4784
Reviewed-on: https://dart-review.googlesource.com/54531
Reviewed-by: Dan Rubel <danrubel@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-05-10 12:44:09 +00:00
Dan Rubel
1860096702
Use correct type arguments for Forest.
...
I'm landing Peter's change:
https://dart-review.googlesource.com/c/sdk/+/54400
Change-Id: I337d4b63a085fbf06f5d5cf93b13b60f70e7cb4f
Reviewed-on: https://dart-review.googlesource.com/54541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-09 20:57:07 +00:00
Dan Rubel
fa071e8ecb
Update AstBuildingForest tests
...
Change-Id: I01398db759d048b588e5b67637370bd528b7828b
Reviewed-on: https://dart-review.googlesource.com/54480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-09 18:57:17 +00:00
Brian Wilkerson
a8364e3412
Add missing method to FastaParserTestCase
...
Change-Id: I49a10b4843910d3fad0a95cc6165c96a5e8da48d
Reviewed-on: https://dart-review.googlesource.com/54310
Reviewed-by: Dan Rubel <danrubel@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-05-09 13:26:23 +00:00
Dmitry Stefantsov
b25e12ddc6
[fasta] Remove BuiltTypeBuilder
...
Change-Id: I8a3678e37ef0c51023c5c52f1fc8e7d11d005c86
Reviewed-on: https://dart-review.googlesource.com/54382
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Peter von der Ahé <ahe@google.com >
2018-05-09 10:36:12 +00:00
Peter von der Ahé
ee0a2cd8bc
Restore type arguments on Forest
...
Change-Id: I3bdce8f470e31e4b95a028842a3f188102b74ba4
Reviewed-on: https://dart-review.googlesource.com/54386
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Peter von der Ahé <ahe@google.com >
2018-05-09 10:01:47 +00:00
Konstantin Shcheglov
cc034472bb
Fix LineInfo.getOffsetOfLineAfter().
...
Or we could remove it altogether.
It is not used outside of analyzer/analysis_server/analyzer_plugin.
R=brianwilkerson@google.com
Change-Id: I89c90fc0881f2b1602128f8aacdda2762c4e7920
Reviewed-on: https://dart-review.googlesource.com/54306
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2018-05-08 20:28:07 +00:00
danrubel
ebcf5bec30
Update Analyzer/CFE type resolution test to use AstBuildingForest
...
This updates the BodyBuilder to accept a Forest for either Kernel or Analyzer.
More work needs to be done to update the Forest type arguments specified in BodyBuilder.
Change-Id: I595535dc05572515a0b7cca5621de35146944ed3
Reviewed-on: https://dart-review.googlesource.com/54180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-08 16:08:52 +00:00
danrubel
316b10216f
Fix Analyzer warning
...
Change-Id: I5bd2c2f7cdf3c218f2079c4f836e3e934aaace68
Reviewed-on: https://dart-review.googlesource.com/54280
Reviewed-by: Dan Rubel <danrubel@google.com >
2018-05-08 16:03:31 +00:00
danrubel
95c29e6fb0
First cut test for Analyzer/BodyBuilder integration test
...
Change-Id: Ie5f956a9a24beb1922b3f7c93603edf28d35d907
Reviewed-on: https://dart-review.googlesource.com/54080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-08 00:30:12 +00:00
Paul Berry
07ad1904f3
Sort declarations in type_system.dart and type_system_test.dart.
...
No changes other than moving around classes and methods.
Change-Id: I2bca30b7bd3bba85d0cbeb2ac2e2fe975aa3db62
Reviewed-on: https://dart-review.googlesource.com/53821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2018-05-04 18:46:56 +00:00
Dan Rubel
64754764b1
Update computeType to call computeTypeParamOrArg
...
This is another step to replacing parseType with computeType
and improving recovery when parsing types and type arguments.
This adds a new computeTypeParamOrArg utility which returns
one of a couple constants for common situations or an instance
of ComplexTypeParamOrArg. The computeType function and
some places in ComplexTypeInfo class have been updated to use
this new method, but there are additional places that will be
tackled in subsequent methods.
Change-Id: I7012b65580e9dbc74b9424456262aa3c0367f48b
Reviewed-on: https://dart-review.googlesource.com/53641
Reviewed-by: Peter von der Ahé <ahe@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-04 13:38:07 +00:00
Paul Berry
8f52be2282
Don't infer types when there's an irreconcilable type mismatch.
...
Also fix the type inference algorithm so that when it explores
multiple alternatives (as a result of the use of FutureOr<>), if one
alternative generated some constraints but failed to produce a match,
it rewinds those constraints and tries the other alternative.
(Previously, it erroneously assumed that if any constraints were
generated, the alternative matched successfully).
Also add unit tests to verify the proper operation of the subtype
match algorithm.
Fixes #32305 .
Change-Id: I060b5d6d5247a68d2b27bba78819bae172e43d97
Reviewed-on: https://dart-review.googlesource.com/53685
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Jenny Messerly <jmesserly@google.com >
2018-05-03 23:27:14 +00:00
danrubel
e93b2ee250
Improve typedef identifier recovery
...
... and also address comment in
https://dart-review.googlesource.com/c/sdk/+/53140
Change-Id: I915fe4433102bfcbdac95bb63416587b03b98680
Reviewed-on: https://dart-review.googlesource.com/53300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-05-03 15:14:43 +00:00
Dan Rubel
79a15f52bf
Fix isValidMethodTypeArguments
...
Change-Id: I3c4bb8dc981c285b8ecfad7dcd7dc849ed1bda7b
Reviewed-on: https://dart-review.googlesource.com/52920
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-04-28 18:10:06 +00:00
danrubel
88a098c71c
Improve fasta parser field name recovery
...
Change-Id: I3a27b765df7543eda56c8ef691d6a3192a2769f1
Reviewed-on: https://dart-review.googlesource.com/52621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-04-27 11:58:30 +00:00
Janice Collins
1afe71c08a
Enable preview-dart-2 as default for analyzer.
...
Based on https://dart-review.googlesource.com/c/sdk/+/52340 , but adds
the necessary plumbing through the test system to pass through
negations to strong and preview-dart-2. Also adds support for those
negations to the analyzer.
Change-Id: I9793ff28bb593d25bbb0a2ed8736b5b53e0a62d8
Reviewed-on: https://dart-review.googlesource.com/52461
Commit-Queue: Janice Collins <jcollins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-04-26 17:01:12 +00:00
Brian Wilkerson
9e9b50d19d
Improve error messages for annotations involving undefined names (issue 27788)
...
Change-Id: Iccfcb73b7671f50353b57a81817dec013b997a53
Reviewed-on: https://dart-review.googlesource.com/52640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-04-25 17:48:49 +00:00
danrubel
8d4074175f
Improve fasta parser method name recovery
...
Change-Id: If0911c8ee8c8d403e711229e6f5f6bd4a8768c9c
Reviewed-on: https://dart-review.googlesource.com/52620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-25 15:09:59 +00:00
danrubel
34a1ba7307
Fix AstBuilder construction of if statement
...
... and update more analyzer tests
Change-Id: Ieed123e16e7ae451cf2046253deb0c7773091417
Reviewed-on: https://dart-review.googlesource.com/52500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-24 22:00:38 +00:00
Brian Wilkerson
7054d92a02
Remove some classes from the analyzer public API
...
Change-Id: Ic53a8426818b06f44c2876abd16c789589bf78b5
Reviewed-on: https://dart-review.googlesource.com/52421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-04-24 15:28:15 +00:00
Brian Wilkerson
bf1d0efde2
Revert "Improve error messages for annotations involving undefined names (issue 27788)"
...
Change-Id: I017592bf8982ff51bb73eb5fe892f8d9cffb9c9d
Reviewed-on: https://dart-review.googlesource.com/52400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-04-23 21:05:53 +00:00
danrubel
07daecf36f
Improve fasta parser skip type variables
...
Change-Id: Icbf546a496dd1665615e4cb70d3fa130f770413d
Reviewed-on: https://dart-review.googlesource.com/52301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-23 16:45:42 +00:00
Brian Wilkerson
1ffd7e529a
Improve error messages for annotations involving undefined names (issue 27788)
...
Change-Id: Ib7af4bdd97e9f775646c90e8f49f021836125b78
Reviewed-on: https://dart-review.googlesource.com/52240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-04-22 20:11:11 +00:00
danrubel
0e46a199fc
Fix type reference prefixed annotation recovery
...
When recovering from an invalid annotation in a type variable
(e.g. "< @Foo.bar T >"), the parser could get stuck in an
infinite loop trying to recover. This fixes that situation.
Change-Id: If01e43b9eec575824329808eeb93437432830654
Reviewed-on: https://dart-review.googlesource.com/52300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-21 15:28:31 +00:00
Mike Fairhurst
ebcd876d0c
Remove broken overrides
...
Change-Id: I7815fb1a139bf4723e29177965cfde8942ef2d3e
Reviewed-on: https://dart-review.googlesource.com/52264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-04-20 22:04:26 +00:00
Konstantin Shcheglov
6865041334
Issue 27098. Check that argument is assignable to parameter in call().
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/27098
Change-Id: I0d5ac65202b632646bd7b26170c55ab985d2523c
Reviewed-on: https://dart-review.googlesource.com/52263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2018-04-20 21:50:59 +00:00
Mike Fairhurst
bd757f9948
Redo #28580 : instantiate bounds to bounds.
...
One thing to be careful of here is that function type bounds may be
left unbounded. However, their parameters and return type cannot refer
to a type parameter for resolve-to-bounds to work.
There are also a large number of ways that this can loop infinitely, and
a number of new guards had to be added (as well as some test cases) to
catch them all.
Change-Id: I14322f5f71d1f7b73b27a870553e5c588b2c7e2e
Reviewed-on: https://dart-review.googlesource.com/52062
Commit-Queue: Mike Fairhurst <mfairhurst@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-04-20 17:25:09 +00:00
Dan Rubel
bdfcc20846
Improve fasta parser formal parameter recovery
...
This CL improves recovery given invalid or malformed formal parameter
types and identifiers. This accomplished by switching the
parseFormalParameter method to use computeType rather than parseType,
improving recovery when parsing field initializers, and in the process,
further reducing the size of parseType and eliminating 6 unused
TypeContinuation elements.
Change-Id: I6f05d8018bf8d9f2c256e5a64408c29db006a8e2
Reviewed-on: https://dart-review.googlesource.com/52000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-19 20:25:58 +00:00
Dan Rubel
8e812ddaa5
Pass modifiers in beginFormalParameters event
...
This CL updates the beginFormalParameters event to include
the covariant and const/final/var modifiers, and cleans up
a number of unused classes and methods including:
* the original implementation of ModifierContext/Recovery
* handleModifier and handleModifiers events
Change-Id: Ie89a202d17872fba85cd1a477091472a8d2d223b
Reviewed-on: https://dart-review.googlesource.com/51380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-17 20:27:37 +00:00
Brian Wilkerson
dd897d35a2
Move the task API out of the public API
...
Change-Id: I0fbafb4965ced89fb9a063edb773c3f1cb3a39fa
Reviewed-on: https://dart-review.googlesource.com/51242
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-04-16 18:18:08 +00:00
Peter von der Ahé
0cbd4b520a
Address review comments from change 51120
...
Change-Id: I017fae6b5bc2c9f8afacd08e9e4d6a1edff2d1db
Reviewed-on: https://dart-review.googlesource.com/51127
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2018-04-16 12:13:01 +00:00
Leaf Petersen
c2b338f1b7
Remove fuzzy arrow support from analyzer
...
Fixes #31637
Change-Id: I87767b92814455187ea71cc4caca786043dbbe3d
Reviewed-on: https://dart-review.googlesource.com/51100
Commit-Queue: Leaf Petersen <leafp@google.com >
Reviewed-by: Jenny Messerly <jmesserly@google.com >
2018-04-13 16:47:16 +00:00
Brian Wilkerson
c214c43758
Make LineInfo a public class
...
Change-Id: I1bc7f5302797374609752ea5293b96c30719b41f
Reviewed-on: https://dart-review.googlesource.com/51101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-04-13 16:23:47 +00:00
Dan Rubel
58a6bfd974
Improve identifier recovery in expressions
...
Change-Id: I6af7f3398953d1f98dd186564af92da14d015f2a
Reviewed-on: https://dart-review.googlesource.com/50560
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-04-12 12:57:18 +00:00
danrubel
072bd1c88e
Remove KernelLibraryBuilder proxies
...
Change-Id: Ib2326bc4700e5063c2885664389a5310d672fbea
Reviewed-on: https://dart-review.googlesource.com/50780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-11 18:12:36 +00:00
Brian Wilkerson
98671b2659
Make DeclaredVariables immutable
...
Change-Id: I3d0233cfb4002140af7cf0166cd98466d73d630c
Reviewed-on: https://dart-review.googlesource.com/50580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-04-11 01:58:51 +00:00
danrubel
5c508ff785
Update more IdentifierContext type reference recovery
...
Change-Id: I7268bce4379ac4613ecd182c9d41022f2a08e7c4
Reviewed-on: https://dart-review.googlesource.com/50521
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-04-10 19:38:41 +00:00
Dan Rubel
5e99872770
Improve missing/invalid type reference recovery
...
Change-Id: I52231fba7ebce51242393a0030325198bf51dfbf
Reviewed-on: https://dart-review.googlesource.com/50340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-09 22:53:28 +00:00
Brian Wilkerson
00097adce0
Remove reference to deprecated setter
...
Change-Id: Ie775c23175363135f58ebc12d476db2640cf200b
Reviewed-on: https://dart-review.googlesource.com/50060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-04-09 13:54:06 +00:00
Dan Rubel
fd87a11ad0
Update fasta parser to generate error when "throw" missing expression
...
Change-Id: I6610400204e111a3a6cc7971159bfdd6c2e58794
Reviewed-on: https://dart-review.googlesource.com/49880
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-04-06 16:10:12 +00:00
Dan Rubel
edb6e776f1
Update parseFields to use typeInfo
...
... and remove typeContinuation from top level parsing,
class member parsing, and ModifierRecoveryContext2
Change-Id: I2a9653e42c180a050316205fdf320c61c30ae47c
Reviewed-on: https://dart-review.googlesource.com/49562
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-05 14:49:46 +00:00
Aske Simon Christensen
bbb281ff3b
Error reporting functions take a list of context messages.
...
Change-Id: I8f48944d3c25099827c820d2b7f49ab44c60abd2
Reviewed-on: https://dart-review.googlesource.com/44462
Reviewed-by: Peter von der Ahé <ahe@google.com >
2018-04-05 13:29:16 +00:00
Dan Rubel
d0ad78db24
Improve recovery when "set" found in function body
...
Change-Id: I11cab70a526fb52b61be9ff91ad94b6fd23044e2
Reviewed-on: https://dart-review.googlesource.com/49340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-04-04 14:43:23 +00:00