Commit Graph

1046 Commits

Author SHA1 Message Date
Konstantin Shcheglov 149ebf683b Support for 'uri' property of Import/Export/CompilationUnitElement.
_Builder in source_gen uses code like this to check that the generated
file is expected in the library. While it is a questionable approach,
I don't feel that I have time to fix it, and remove the `uri` property
completely. So, we fix in in Analyzer with summary2.

`if (!library.parts.map((c) => c.uri).contains(part)) { ...fail... }`

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

Change-Id: I983f29589cbb2613d5f896b87f6218c31a47afa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-11 16:53:03 +00:00
Konstantin Shcheglov b9e877be78 Extract informative data from linked data.
So, that when changes to code that don't affect APIs are made, we
can use already linked bundles, and fuse it with informative data to
create elements with actual offsets and comments.

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

Change-Id: Ia0aa8af3c734b2cff497b49363064a26d601ebf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 14:14:10 +00:00
Konstantin Shcheglov 9d4649a44c Set context type for downward inference in constants.
R=brianwilkerson@google.com

Change-Id: Ifca9953d970906c7291c32f8db6f4d294429cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-31 18:31:44 +00:00
Konstantin Shcheglov b3f262298c Fix recording covariance for default parameters.
R=brianwilkerson@google.com

Change-Id: If904634685a223713e467fc93c0e04afd1378ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-31 16:56:44 +00:00
Konstantin Shcheglov 0a66b3e644 Fix scopes for resolving class / mixin headers.
R=brianwilkerson@google.com

Change-Id: I981fc1b76435d2a7e2ae1045f49ade12febafa01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104186
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 21:13:15 +00:00
Konstantin Shcheglov b1d3a212a7 Fill references to dynamic/Naver in LinkedElementFactory.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I85f61c6322a6332ac6b095aaf8cf4203460babc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-29 01:20:42 +00:00
Brian Wilkerson 2e51423c3d Convert the way function types are displayed to better match the syntax of Dart
Change-Id: Id5068bd52b3a35c70cb0d2ccc735469e2f8a0d3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103701
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-28 20:48:51 +00:00
Konstantin Shcheglov 5e5b03881c Fix for exporting setters.
R=brianwilkerson@google.com

Change-Id: Ie67834547a94a480e8ed86df430c40bcb36e37e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-19 17:50:09 +00:00
Konstantin Shcheglov 234103f9d4 Fix for hasImplicitReturnType.
R=brianwilkerson@google.com

Change-Id: I94e1e0f8246f3ff0d284ef7b1de6f618ad464592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102984
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-19 17:50:07 +00:00
Paul Berry 2d8fc016b9 Sort declarations in resynthesize_common.dart
Change-Id: Iec0312bf5dc0abdbe9729c90bebade65b2ba3c74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102982
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-18 15:47:46 +00:00
Paul Berry f930d674ca Restore old nullability behavior of TypeParameterElement.type.
It doesn't work to make TypeParameterElement.type choose
nullability/non-nullability based on the enclosing library, because
for type parameters of synthetic function types, there is no enclosing
library.

Change-Id: Ic74cc639534e3c03f3c46e7eacfb5655ca74019a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102981
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-18 15:05:26 +00:00
Konstantin Shcheglov 9b1c8fca91 More fixes for GenericFunctionType.
1. Read GenericFunctionType fully, but in two steps to avoid recursion.
   We need to read it fully, because it might be a part of a const
   initializer, so the client might request the initializer expression,
   and there is no way to him to finish reading. Amnd in general, we
   don't read expressions lazily.

2. For consistency we need to set identifiers for all GenericFunctionType
   nodes that we want to store. So, DeclarationResolver should be updated
   to move the identifier number even though we don't use the same
   mechanism for building elements ininitializers, as we use for type
   annotations outside expressions.

R=brianwilkerson@google.com

Change-Id: I58faa5408bff5250a8c775249438def7f742594b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102840
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-18 00:20:36 +00:00
Paul Berry 8d52c0d08e Store library nullability status in LibraryElement; adjust TypeParameterElement.type based on it.
Change-Id: I0a9673b3b2f46bbf5c3aea429e90c6ddafa978e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102224
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-17 21:27:21 +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
Paul Berry 11b59bec8d Store compilation unit NNBD status in unlinked summary.
This is needed for two reasons:

1. Summary linking, because type inference needs to behave differently
for opted-in vs. opted-out libraries.

2. Summary resynthesis, because TypeParameterElement.type needs to
behave differently for opted-in vs. opted-out libraries.

Note that reason 1 won't apply to the summary2 mechanism, because it
has access to full ASTs when doing type inference.  But it will still
need to record compilation unit NNBD status for reason 2.

This CL merely stores the correct data in the summary; it doesn't
address resynthesis, linking, or summary2.

Change-Id: I1aa2226e5865ef76747267de6198223997d6ad0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101920
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-10 21:34:08 +00:00
Konstantin Shcheglov 678f4bb926 Give featureSet to analysis options to fix resynthesis tests.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I757327377b3fb2b8e945f0938d5d523f83decfaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101940
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-08 23:58:10 +00:00
Paul Berry 1407e59079 Add preliminary NNBD support to the summary linker.
Change-Id: I256d66333d9715ed720bd6ea87d21fd00e17635a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101900
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 22:35:49 +00:00
Paul Berry 34d2fd42bd Add summary deserialization support for nullability.
In a follow-up CL I will add nullability support to the summary
linker.

Change-Id: I99f3dce1a695da65c7c09c11e73462c93aeb637f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101882
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 22:30:39 +00:00
Paul Berry 51fe641e82 Create a SynchronousSession class.
In the long term this class will take over much of the role played by
RestrictedAnalysisContext.  For now it is simply a container for the
analysis options, declared variables, type provider, and type system.

In follow-up CLs I will plumb this object through various parts of the
analyzer, especially the LinterContext; this will enable the
canBeConst... methods to be moved into SynchronousSession, and that
will allow us to stop creating a LinterContext in
BestPracticesVerifier.

Change-Id: I7ac2d386c10d2e5339d9715848b185c163e1f858
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-08 19:57:31 +00:00
Brian Wilkerson f80f0bfcfd Reland "Implement the type Never"
This reverts commit 78e50a5f9b.

Change-Id: I2ec4cdcfda4a6d199308a3b25a2ed0792e9d9a26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101621
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-08 13:26:45 +00:00
Brian Wilkerson 78e50a5f9b Revert "Implement the type Never"
This reverts commit 40a06c3a77.

Reason for revert: Introduced a bug that is blocking a roll.

Original change's description:
> Implement the type Never
> 
> Change-Id: Icbf407bc19f602c8382946b1e735905cc165c59c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100993
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Iebb5b8327b0be7129298f39b343555b812314abf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-07 16:22:37 +00:00
Konstantin Shcheglov c331ce69a3 Update extract implicitly typed instance property tests.
The reason when there is a difference in summary1 and summary2 behavior
is that in summary2 we link cycle by cycle, and in summary1 we link
all requested libraries together.

R=brianwilkerson@google.com

Change-Id: I173d37d7a6b6c766c641715c6dbce7c1701139f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101492
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-07 15:20:46 +00:00
Konstantin Shcheglov 259ab698ab Fix for CompilationUnitElementImpl.nameOffset and type alias code range.
R=brianwilkerson@google.com

Change-Id: I90bb0b74ea52eea883ee4c8accb8f2055ba568a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101490
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-06 22:01:12 +00:00
Paul Berry 3020127fc4 Change resynthesis test expectations to use new Function syntax.
This is necessary in order for resynthesis tests to be unambiguous in
the presence of NNBD, because with the old syntax, it wasn't clear
whether a type like `() -> int?` meant `int? Function()` or `int
Function()?`.  In a future CL, we'll make a similar change
FunctionType.toString().

Change-Id: Iedf6162de53c7fe57f858913d8e82faac17971c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101242
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-03 16:51:09 +00:00
Paul Berry 974babb5f1 Remove named argument nnbd from summary testing methods.
These tests now use the FeatureSet mechanism to opt in and out of NNBD.

Change-Id: Id836833d4479e396e8db2b3646d28da339ed5674
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101076
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-03 14:29:41 +00:00
Paul Berry f3d8b420a0 Consolidate all NNBD enables in summary_common.dart.
Change-Id: I3cc0363f82674fd1a59ff0c3e2d11e46a72a0d4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101075
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-03 14:29:41 +00:00
Paul Berry 0950a540d7 Convert summary_common.dart to triple-slash comment style
Change-Id: Ife2401515d2a755082a5021631880f8d79e637c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101074
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 21:37:18 +00:00
Paul Berry e25aefc8d6 Consolidate all NNBD enables in resynthesize_common.dart.
I elected not to provide an `sdkVersion` argument to FeatureSet for
these tests, on the grounds that if any new features are added to the
SDK before NNBD, we want to make sure that those features are
compatible with the NNBD summary behavior.

Change-Id: I62e383e903b5756dcbb8cb498e71c4e739731d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101070
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-02 21:29:13 +00:00
Konstantin Shcheglov 70e00c9a37 Handle ClassTypeAlias without valid Function.
R=brianwilkerson@google.com

Change-Id: Ibc160658b75f7d5a450548e12aa5dc96be674f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101072
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-02 21:01:30 +00:00
Paul Berry a334395edf Switch to using FeatureSet in summary tests
Change-Id: I16b13a2509836485417013da48d5b1ae4c92f618
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101069
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-02 20:46:13 +00:00
Brian Wilkerson 40a06c3a77 Implement the type Never
Change-Id: Icbf407bc19f602c8382946b1e735905cc165c59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100993
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-02 16:31:23 +00:00
Konstantin Shcheglov 143ebf1c1c Compute default types for type parameters of GenericTypeAlias.
R=brianwilkerson@google.com

Change-Id: Ifbfa8e240b078285660b80fbb02914bc6666b753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100985
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-01 20:06:39 +00:00
Konstantin Shcheglov b6997deb3e Resolve typed constant initializers separately.
R=brianwilkerson@google.com

Change-Id: Id54b57a40004de0c9adc345e1f944fc89b568e68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100929
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-01 14:19:20 +00:00
Konstantin Shcheglov 25daff618d Support for 'late' keyword.
R=brianwilkerson@google.com

Change-Id: Ia731b56ab67d0d33af9a8ab4786d9204544a57ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-30 16:58:44 +00:00
Konstantin Shcheglov 532226f024 The library is synthetic when its defining unit is synthetic.
R=brianwilkerson@google.com

Change-Id: I9afbea2214e07f968deb74b490a27090766f8823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100794
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-30 00:21:27 +00:00
Konstantin Shcheglov c944328528 Refactor types resolution, compute default types for type parameters.
R=brianwilkerson@google.com

Change-Id: If8b89c611c10c0026ec40773aed2a38a5fb37b23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100787
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 21:44:05 +00:00
Paul Berry e2d0f5a50b Add featureSet parameter to Parser constructor.
And deprecate old parser configuration setters.

Change-Id: Ib1507b8d2b20be7c883061e2a92ec9205d6a378f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100664
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-29 16:42:19 +00:00
Brian Wilkerson 4da31564cb Fix the placement of late in two tests
Change-Id: I94e978a453441aeceac72e14873c9e7e895e5c32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100466
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-25 13:24:31 +00:00
Konstantin Shcheglov f04cac8fbd Implement inheritsCovariant.
R=brianwilkerson@google.com

Change-Id: Ieedcec9e51ad7c3e1087d114522b577998181c1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100407
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 20:29:05 +00:00
Brian Wilkerson 2cadc90ec5 Add summary support for isLate
Change-Id: I21fe14778e24477f234e2a1a1fe65a23ebd05e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100274
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 20:23:45 +00:00
Brian Wilkerson e42c5d12fe Cleanup tests by removing references to enabled experiments and by reducing duplication
Change-Id: Ic7eb96e1724d2a51469e41760856d4194e3379e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-24 13:20:36 +00:00
Paul Berry 9af0574287 Remove unused import
Change-Id: I6fc0c75afc22b31e101631dac366b58a2f2ba8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100285
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-24 01:17:15 +00:00
Konstantin Shcheglov 594a0ef7a7 Perform instantiateToBounds() even for not simply bounded types.
Apparently my previous understanding was wrong.

R=brianwilkerson@google.com

Change-Id: I17ccce93d8e6b8744eaf05c80782ae4f1fe4a414
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100090
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-04-23 17:39:08 +00:00
Paul Berry cee1e41fe8 Plumb new FeatureSet class into Scanner.
And change clients of the scanner (within the SDK) to use it.

Long term, it would be better to store the FeatureSet object directly
in the Scanner and remove the existing flags `enableGtGt` and
`enableNonNullable`.  However there are analyzer clients that
currently use these flags.  So for now, we simply plumb in the
FeatureSet as a new way of setting AstBuilder flags.  Once we've
updated clients to use FeatureSet, we'll publish a breaking version of
the analyzer that removes the old flag API.

Change-Id: I9e662f4ed45668d9acd4f56e42d7d8dae6180d48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99975
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-23 16:13:43 +00:00
Paul Berry d50232a3f5 Plumb new FeatureSet class into AstBuilder.
And change clients of parser and AstBuilder (within the SDK) to use
it.

Long term, it would be better to store the FeatureSet object directly
in the AstBuilder and remove the existing flags `enableNonNullable`,
`enableSpreadCollections`, `enableControlFlowCollections`, and
`enableControlFlowCollections`.  However there are analyzer clients
that currently use these flags.  So for now, we simply plumb in the
FeatureSet as a new way of setting AstBuilder flags.  Once we've
updated clients to use FeatureSet, we'll publish a breaking version of
the analyzer that removes the old flag API.

Change-Id: I6d37177c40b1a1216956e95f473252aa218d10b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100000
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-22 13:38:59 +00:00
Brian Wilkerson af0fa108da Add support for required named parameters
Change-Id: Iebfd8da18c6f2158ed39043ab116e2670a7329c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99717
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-04-19 19:25:01 +00:00
Konstantin Shcheglov 9e87c16677 Record TopLevelInferenceErrorKind.dependencyCycle in summary2.
R=brianwilkerson@google.com

Change-Id: I1869f31dd6163827026e8e9d54e8682cb9ab2405
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-19 15:45:34 +00:00
Konstantin Shcheglov fa7485f28e Build types for not simply bounded elements using dynamic type arguments.
R=brianwilkerson@google.com

Change-Id: Ia3c2d5193212a8cf58caad2323185e1ac9e31c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99716
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-18 20:14:49 +00:00
Konstantin Shcheglov 7b6b8f8c43 Restore 'parameters' and 'typeParameters' for ParameterElementImpl.
This partially reverts https://dart-review.googlesource.com/c/sdk/+/5000
which was done during moving toward integration with Kernel, which
we don't do anymore.

With summary2 the FunctionType of a function type parameter is purely
synthetic, without its original element. However parameters in
function typed parameters still exist as nodes, so they must have
elements.

R=brianwilkerson@google.com

Change-Id: I6689b05459f3989a20839346013c80a86ac8dc7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99709
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-04-18 14:10:18 +00:00
Paul Berry bc58bf598e Add summary serialization support for nullability suffixes.
Resynthesis support will be added in a future CL.

Change-Id: I652da0c1ba60d8e41179e952294b4a4b45961347
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99702
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-04-18 12:11:08 +00:00