Commit Graph

7128 Commits

Author SHA1 Message Date
Konstantin Shcheglov 6c4f354458 Consider 'exclude: foo/**' as excluding the whole directory 'foo/'.
Change-Id: If75fb54929e01481b8511ef83a621a2bdf853c40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-18 19:00:57 +00:00
Sam Rawlins 860aa67a02 Analyzer: convert two test cases to null safety; document two others
Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I3788f2bb7e7b082a2732a3a77fe59d3547f53f40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185484
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-18 17:20:57 +00:00
Sam Rawlins d2bbb91872 Analyzer: Report on more invlid error handlers.
Bug: https://github.com/dart-lang/sdk/issues/35825
Change-Id: I43060e9b0b0a764f14be041c5cbdf1d884d92326
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-02-17 15:12:25 +00:00
Sam Rawlins 0897b95f3c Analyzer: Support const Symbol('>>>')
Bug: https://github.com/dart-lang/sdk/issues/44908
Change-Id: I7af5587317da43f79f043dd7e92976e1011935ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-17 08:22:39 +00:00
Sam Rawlins dbe2dee928 analyzer: Add tests ensuring that duplicate operator parameter errors are not raised
Change-Id: Icb9e68164d36010ea6c7b1f83356d592b2bc8416
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185204
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-17 05:24:40 +00:00
Sam Rawlins e05ad3ae9d Migrate NonErrorResolverTest to null safety
In order to do this, I split the test into two:

* many test cases were concerned with type promotion
  which only seemed to pertain to pre-null safe code.
* some code could not be made valid in both null safe
  and pre-null safe environments.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I818a39f2e3eb3cae17de18b008d9e4c7b8ff84c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184844
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-13 03:40:48 +00:00
Sam Rawlins 33910fe2b8 Analyzer: Add wrong-number-of-params error for triple-shift
Also, add more triple-shift tests.

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

Change-Id: Ic14c6fe4f24d955fbdfd1875b21b1881251bd859
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184700
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 22:48:40 +00:00
Paul Berry 957c0a1c9d Improve "why not promoted" info for field/property reference.
When reporting that a null check is needed due to a lack of type
promotion, and the thing that was not promoted was a reference to a
field or property, the CFE and analyzer now report "why not promoted"
using a context message that points to the definition of the field or
getter.  (Previously the CFE reported a context message with no
location, and the analyzer didn't report "why not promoted").

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: If1841727b8b60dd87c43f239e6a06b98f363801f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184522
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-12 22:43:55 +00:00
Sam Rawlins 89f563c4d3 analyzer: add triple-shift experiment to all tests
Change-Id: I560f82b239d78b748f6e2298a291d71cd2c831a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184840
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 21:17:54 +00:00
Konstantin Shcheglov 51950ab881 Add Resource.parent2 that returns non-null Folder, add Folder.isRoot
A bigger version of than https://dart-review.googlesource.com/c/sdk/+/184381
This is breaking change, so we do this in steps.

Change-Id: I0c7212a073b605ade56657036543c604651810c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184581
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 19:09:20 +00:00
Konstantin Shcheglov 0a04e2ec0f Either2, update Glob to it.
Change-Id: Iae85869339b0c7a35950408c74be08d52b6b5a4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-12 18:02:05 +00:00
Sam Rawlins 337bba0ee9 Analyzer: add triple-shift constant test
Bug: https://github.com/dart-lang/sdk/issues/44908
Change-Id: If510a9aa36fa028e8f91d3cc9dd161282d2db383
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-12 17:45:36 +00:00
Konstantin Shcheglov f6a6e57689 Issue 44223. Improve diagnostics for type arguments violating type parameter bounds.
Bug: https://github.com/dart-lang/sdk/issues/44223
Change-Id: Ia3ffddbc7d2a1be8455f642c5799d21051eefb1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-12 17:37:53 +00:00
Sam Rawlins 896d72a841 Analyzer: introduce more non-function typedef test cases
Bug: https://github.com/dart-lang/sdk/issues/44078
Change-Id: I9b4f299c61034301b5a9c403f128a614384236ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-12 17:37:33 +00:00
Konstantin Shcheglov 875af7c991 Deprecated TypeProvider.futureType2/listType2/etc
Change-Id: Ia994be1e29b4d96b89d714beafcb9256a0cb4de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-12 17:26:07 +00:00
Daco Harkes 34e3f571ac Reland "[vm/ffi] Disallow empty Structs"
Closes: https://github.com/dart-lang/sdk/issues/43974

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I35e6f5315826a751e5ce017a6a618c2c224c0f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180189
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-12 15:35:29 +00:00
Sam Rawlins 726e6c65a9 Add non-function typedef tests to for_in_* diagnostics
This also standardizes on using otherwise unused elements in an expression
statement so as to avoid UNUSED_ELEMENT results.

Bug: https://github.com/dart-lang/sdk/issues/44078
Change-Id: I660530509c6224f1aca01d3317483583ea9c581a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-12 00:34:39 +00:00
Konstantin Shcheglov 27e707268f Always crawl up in getOptionsFile()
Change-Id: I424cd625f05d9bc10ae0366e0332e96496633062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 23:24:11 +00:00
Konstantin Shcheglov 3d8d4b4c2b FunctionExpression always has a body, at least EmptyFunctionBody.
Change-Id: I0d09df2571436f30a7706e657a98056a021e25e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 18:00:11 +00:00
Konstantin Shcheglov 244964d893 Refactor ContextBuilder.createPackageMap() and createWorkspace() into static methods.
There are places when we need to call createWorkspace(), but we don't
have enough data to create full ContextBuilder, because we don't
know SdkManager.

Change-Id: I12ec5701ecab897bf1c49c478e8487c7ca348a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:52:53 +00:00
Sam Rawlins 931203b702 Analyzer: Migrate undefined_operator_test test cases to null safety.
Behavior has changed sufficiently for some of these test cases that I split the
test class into two:

* Any tests which concerned null were moved strictly to the pre-null-safety
  class; different diagnostics are reported under null safety.
* Any tests which concerned type promotion and compound assignment were
  duplicated; promotion changed enough that both cases can be tested.

Change-Id: I069e03b2f97539b0824954b00a5c0484265dd0ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184106
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-11 00:27:06 +00:00
Sam Rawlins 1f870bd3cd analyzer: Deduplicate two WithNonFunctionTypedefTest classes
Since non-function typedefs are enabled by default with
PubPackageResolutionTest, these test classes are currently
unnecessarily split.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I0ab32931371fb917df11e45250c84528af9b9e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184206
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-11 00:25:51 +00:00
Sam Rawlins af0120803e analyzer: Remove unnecessary imports
Change-Id: Iea88852d6592e14007e9853aa2d568a772678e1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184282
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-10 21:37:45 +00:00
Konstantin Shcheglov 8120c43d85 Replace 'Expression.staticType!' with 'typeOrThrow'.
It is not a huge improvement, because it does not add static safety,
for this we would need to distinguish between unresolved and resolved
expressions, as separate types.

But it is still an improvement.

1. We get to know the node that was not resolved.
   Maybe not enough, in case if it was because of the enclosing
   now that this node was not resolved. But still something.

2. We group this use case into one place.

Change-Id: I2e8f029e8a5fcd8ccecdd1b6bc9d78ee9eaf12a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184103
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-10 17:19:27 +00:00
Konstantin Shcheglov b4409ea3b4 Deprecate FunctionType.element/typeArguments
Bug: https://github.com/dart-lang/sdk/issues/44629
Change-Id: I5009a1abd456f33738d3b5e2ecae24b269b20000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-10 17:17:58 +00:00
Sam Rawlins 62c8619fe2 Analyzer: Remove TODO on SwitchExpressionNotAssignableTest.
SWITCH_EXPRESSION_NOT_ASSIGNABLE is only a pre-null safety code. Under null
safety, CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE is reported
instead, and this case is covered in those tests.

Also tidy up CaseExpressionTypeIsNotSwitchExpressionSubtypeTest.

Change-Id: I7c3b489200b6a8181fdf4ae7b36f826ba0b7bd6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-10 05:05:08 +00:00
Sam Rawlins 8b1bb75f19 Analyzer: non-function typedef test cases in diagnostics a-e
Bug: https://github.com/dart-lang/sdk/issues/44078
Change-Id: I1b56ab31a61da23536184d78a3cae576336d0298
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183922
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-10 03:46:48 +00:00
Devon Carew 4ca94b044c [analyzer] remove a comma from one of the analyzer's hint messages
Change-Id: Idd72c1a6b058a4de8b8e4a079723cb29e521aa48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-02-10 01:56:17 +00:00
Sam Rawlins 8dae00fca2 Analyzer: Opt all PubPackageResolutionTest tests into non-function typedef experiment
This also deletes WithNonFunctionTypeAliasesMixin and all mixin
applications.

With how the tests are set up, I had to migrate a few other test cases
to use null safety. A few tests were written in pairs, one
pre-non-function-typedefs, and one post-. These should be combined, but
doing so in this CL would create a much larger diff, with the sorting.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: Iee7f329ee8d841905f08249888de85256187d84b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184080
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-10 00:47:57 +00:00
Konstantin Shcheglov bcbebc8fd5 Fix for resolving package: URIs with space in BazelPackageUriResolver.
Change-Id: I0de91dcb2438205b476dea99fa2231dd189ef094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184042
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 22:26:59 +00:00
Konstantin Shcheglov 4765ef5037 Remove 'actualUri' from UriResolver.resolveAbsolute()
Change-Id: I87edfa780e891a5e1ecdd1a9a548509e4cfa641a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 22:17:08 +00:00
Sam Rawlins dbfcf237d0 Analyzer: Migrate 5 more test classes to use null safety
Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I80135a4ae03820438547223938b1ee4dababdd7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-09 21:09:39 +00:00
Sam Rawlins 03ae836f53 Analyzer: Add conflicting generic interface tests with non-function typedefs
This also simplifies the test file by removing the pre-null safety test
class.

Bug: https://github.com/dart-lang/sdk/issues/44078
Change-Id: I072b69c2ad39c7a87827187f67cec10e47989161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-09 20:41:05 +00:00
Konstantin Shcheglov 36c63c1269 Issue 44865. Report USE_OF_VOID_RESULT for ConstructorFieldInitializer.
Bug: https://github.com/dart-lang/sdk/issues/44865
Change-Id: I4af50cc92a155df08895eb3699cf86a3a6c45858
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183763
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 17:13:49 +00:00
Daco Harkes 5c4a916dc8 [analyzer/ffi] Support inline arrays in Structs
This CL does not add inline arrays to `dart:ffi` yet, only to the mock
SDK in the analyzer for testing the analyzer. This means we can review
and land it separately.

Closes: https://github.com/dart-lang/sdk/issues/44747
Bug: https://github.com/dart-lang/sdk/issues/35763

Change-Id: I7df6a61ea4cfa522afd12194dd2f3573eb79b3ef
Cq-Include-Trybots: luci.dart.try:analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183684
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 11:38:06 +00:00
Sam Rawlins 7b1c194057 Analyzer: deduplicate resolution tests where the null safety test has no new test cases.
Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I4620377cb78a2e3d89e772322636a775bcfd8ba0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183782
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-09 04:31:47 +00:00
Sam Rawlins 88332241f0 Analyzer: Deduplicate some resolution tests
In each included file, there is a test, and a WithNullSafety test which _does
not override_ any test cases from the base test. So the test classes are
combined into one, which is null safe. No test cases are added or removed, but
because of sorting, the diffs may be large.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: Ia9bd2c512ccaa5b8de6fbe454c1275f1b8e889a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183783
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-09 01:34:02 +00:00
Sam Rawlins 82bcd13476 Change PubPackageResolutionTest to use null safety.
Some tests had some issues migrating to null safety that I
could not immediately hash out, or may warrant some more discussion.
So I've added WithoutNullSafetyMixin, and we can incrementally
migrate these after this CL.

Many tests have little no-op tweaks to make them null safe, like
initializing variables, adding late, making nullable.

Nest steps:
1. Remove `WithNullSafetyMixin` applications.
2. Remove `WithoutNullSafetyMixin` in every position with a TODO for
   #44666.
3. For every file with pair(s) of test classes (one pre-null safety,
   and one null safety), move around test cases so that they generally
   run with null safety, unless they are testing things very specific to
   before and after null safety.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I0512dedcda42e864fd580af4842702095937bdb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183140
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-08 23:06:04 +00:00
Sam Rawlins 8432b379e7 Analyzer: Prepare tests for null safety.
Tests that include, for example, a field `int a;` need to be migrated to
something which is both legal in pre-null safety, and in null safety. So no `?`
etc,. Additionally:

* parameters to `main` must be correct,
* new flow analysis may change inference,
* avoid `List()`

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I77b7c3a6f391953c74824153012c1a537f8bebe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183520
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-07 19:45:56 +00:00
Konstantin Shcheglov 2e3ac0cf15 Don't assert that T2 and T3 are num subtypes.
Bug: https://buganizer.corp.google.com/issues/179461891
Change-Id: I87be38a09aade855413382b1d86476c295c4e317
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-06 02:57:06 +00:00
Paul Berry d5fc9fb06f Unit test generic annotation functionality of AstCloner.
The update to AstCloner was made as part of
ba5064fa31, but it couldn't be unit
tested until now due to the lack of parser support.

Bug: https://github.com/dart-lang/sdk/issues/44838
Change-Id: If2fd5ce41a46c3460b5f90ba854f22ae1baef11c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-05 22:43:08 +00:00
Paul Berry c14fd57acc Update AstBuilder to handle generic annotations.
Bug: https://github.com/dart-lang/sdk/issues/44838
Change-Id: If69cbbc13a087f0f6280da0bc7f9dbca1d3ec0ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-05 20:57:18 +00:00
Paul Berry ba5064fa31 Analyzer AST changes for generic metadata
Bug: https://github.com/dart-lang/sdk/issues/44838
Change-Id: I55b8dacc571570568c1b3f101a1a4e1f517f7f6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182581
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-04 09:45:47 +00:00
Jens Johansen 1392263ecc [parser] Non-crashing recovery of in-progress generification of typedef
Fixes #43090

Change-Id: I1377ebf08a8c561e4f15abbf458c5bb0d8c61494
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182040
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-04 08:01:07 +00:00
Konstantin Shcheglov 2038d4fed1 Remove a few usages of FunctionTypeAliasElement in analyzer.
Change-Id: I64a09b9de5ded6cf9116c3abe0f3fbcc8105387c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182660
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 20:29:39 +00:00
Daco Harkes fb624c4209 Reland "[vm/ffi] Change Pointer<T extends Struct>.ref to use static type"
This CL changes the semantics of `Pointer<T extends Struct>.ref` to use
the compile-time `T` rather than the runtime `T`.

This enables tree shaking of subtypes of Struct and optimizing `.ref`.

Bug: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/vmspecific_static_checks_test.dart
TEST=tests/ffi/*struct*test_.dart

Change-Id: Ie19bc3259d1cb721d0ce56d68e82d09dc3a4ad0e
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180190
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-03 10:55:49 +00:00
Konstantin Shcheglov 7834aef945 Fix for NPE when an ambiguous getter is used as an annotation.
Change-Id: If0e2d597099c8eb64479a9dce4ed83dde08e8a65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182371
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 01:27:10 +00:00
Konstantin Shcheglov d1d8730472 Don't use part-of library that does not have the part file.
Bug: https://github.com/dart-lang/sdk/issues/44840
Change-Id: I7e7353472e5deaa3f63c6f461f547149b04d1fb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182366
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 23:54:16 +00:00
Konstantin Shcheglov e1273e96e8 Support URI in PartOfDirective in ToSourceVisitor.
Change-Id: I8e0eb8d55de3c78ad7723946296010136634f000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182364
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 22:16:44 +00:00
Konstantin Shcheglov 977f1717e1 Fix for null in ElementImpl.session when synthetic getter/setter.
Change-Id: Id32003c3644275210778667f07bb49baddbfbdc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182362
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 21:36:34 +00:00