Commit Graph

10502 Commits

Author SHA1 Message Date
Konstantin Shcheglov 1faa9f0f8c Prepare to publish analyzer 1.0.0 and _fe_analyzer_shared 16.0.0.
Change-Id: I07d357397cd6bd1ed240256efe5f19ed44111148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-10 19:46:55 +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
Devon Carew 3f8c508a94 [analyzer] don't analyze html files
Change-Id: I45fa266be055a7d6ca1c0ecb90dc8245fa8b4616
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184102
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-02-10 15:52:24 +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 a0b275911a Stop visiting typedefs of return types.
Change-Id: I1e3936f7a819add5f93fcf2974ba5d928cd68aef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184043
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 23:14:39 +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
Konstantin Shcheglov 257fae8937 Throw StateError with debug data when a URI cannot be resolved back to path in getFileForPath()
Change-Id: I361826b0f878b74e848f38ae11422007c06e341f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 22:16:49 +00:00
Konstantin Shcheglov b7b88d53f7 Tweak FfiVerifier._validateSizeOfAnnotation()
Change-Id: I43fc092294e29f10c8b7266e4ef575131a04c6e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 21:55:51 +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 79396b13bf Migrate analyzer flat buffer generator to null safety.
Change-Id: If16c57cc443002f90f7f94b2e08294eb8bb44225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183766
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 17:14:00 +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
Konstantin Shcheglov aa5cf01135 Issue 44889. Enable null safety in tool/experiments/experiments_test
Bug: https://github.com/dart-lang/sdk/issues/44889
Change-Id: I7e424d68f81a7558428e3e92c159d1aea5974188
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183764
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-09 01:06:40 +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
Paul Berry 680f5e6da5 Clean up error message nomenclature around metadata vs annotations.
Change-Id: I866900d2c4baca6ee000885f2126de2a97e643ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182800
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-08 22:00:04 +00:00
Konstantin Shcheglov 557112403e Prepare to publish analyzer 0.42.0-nullsafety.0 and _fe_analyzer_shared 15.0.0.
Bug: https://github.com/dart-lang/sdk/issues/44290
Change-Id: I3e1be773b4a8b2ec4be2eb93608b10d26858db9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183143
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-08 19:51:15 +00:00
Konstantin Shcheglov 86636aff07 Use empty placeholders for List(s) in elements.
Change-Id: I1d63fe018a0a78cfdf2e9e7ec91aefdc9cd91bb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183500
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-08 18:09:33 +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 9624709abf Remove ForMixin and IfMixin.
Change-Id: I1487d5487b43c910f8ac313dd3ea54430da48009
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183420
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-07 02:13:46 +00:00
Konstantin Shcheglov 8a88268f20 Eliminate 'lazy' from AST.
Change-Id: Ied5452b85824f169d92957f852864589d94d32da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-06 18:11:16 +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
pq 7844db28a0 add test dir checking to LinterContext
Change-Id: I53730f982a265d063c29cf8e485f1d4d84a6b65d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-02-06 02:05:19 +00:00
Loren Van Spronsen c426bc5eff Correct the inline grammar in the SimpleStringLiteral dartdoc.
Change-Id: I03956ea2e7f2dfba45bab265b0ab7a7b86559224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-06 01:46:48 +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
Konstantin Shcheglov 6b793358ca Update NodeListImp constructors, owner, initialize.
Both Brian and Paul noted that in general we should express the
semantics correctly, if something is expected to be not null before
it is used, it would be nice to type it as such. This change makes
`_owner` late final, so that it is always not null, and set only once.
It should not affect performance negatively because almost always
we use `owner` inside `_initialize`, where it is a local variable.

Change-Id: I2abe45f2f98e9ac0ce69d4a65d641334244876ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183044
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-05 22:29:18 +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 93cd0cdd3b Parser support for generic annotations.
This CL updates the parser so that it allows annotations of the form:

    `@` <constructorDesignation> <argumentPart>

Where <argumentPart> can contain type arguments.  Previously this was
prohibited at parse time.

Generic annotations are still prohibited in the current language
version, but the error is now generated by the parser listener
(BodyBuilder in the case of CFE, AstBuilder in the case of analyzer);
this should open the door for future CLs to add support for generic
annotations when the `generic-metadata` experimental flag is supplied.

Bug: https://github.com/dart-lang/sdk/issues/44838
Change-Id: I90604f38bcb378fc798c5737e486fb26589d4d1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182668
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-05 20:57:18 +00:00
Konstantin Shcheglov a7f84dc626 Make NodeList fields in AST final not lazy.
Change-Id: Ia145ea52a7a13ce8d97708a135099ef064ec3397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-05 00:25:02 +00:00
Konstantin Shcheglov 9cbe1cafe0 Element.session can be nullable
This is not convenient, and not nice, but it can be.
We have to accept that it can for now, and plan to make it better.

Bug: https://github.com/dart-lang/sdk/issues/44837
Change-Id: Icbd2d55b6690ed817b38a7768198c41ce36cf002
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182960
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-04 22:02:29 +00:00
Alexander Thomas c88171c8af [sdk] Bump version to 2.13
TEST=Presubmit tests and local builds
Change-Id: I1b15d60eced0cf3f422548eda75706609f6640cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182624
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-04 12:10:17 +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
Sam Rawlins 43e4536ebb analyzer: Fix documentation for TypeProvider
Text like "Future<Null>" turns into an HTML tag. Referencing the elements with
[] escapes the HTML and creates links for the user.

Change-Id: Ib20020f879ec1eef4a5d98e896f72b00242deac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-03 21:53:59 +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
Konstantin Shcheglov 7313f905e3 Remove 'functionTypeAliasElement' from 'TypeSystem.instantiateToBounds2'.
Change-Id: I402d55b1ccdc0178680406c5f6135b497115a1c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182603
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 19:54:29 +00:00
Paul Berry 0427342228 Add flag for generic metadata
See implementation plan PR:
https://github.com/dart-lang/language/pull/1417

Change-Id: Ib75026d7008d313f3dad94d9ccf47e341f945dc9
Bug: https://github.com/dart-lang/language/issues/1297
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182301
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-03 13:54:48 +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 125bec8d78 Rewrite ElementAnnotation.isXyz with helpers, avoid null checks.
Change-Id: I48dc83fe0002a45833d3059e87afa7a090a18180
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182420
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 05:35:28 +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 cadf512b67 Issue 44841. Add debug information into LinkedElementFactory.
Bug: https://github.com/dart-lang/sdk/issues/44841
Change-Id: Ie82506ff80b39029d4c9caecab42580f4b473a89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182400
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-03 00:19:50 +00:00
Paul Berry 91540068d3 Analyzer: Fix null safety migration error in message generation
When generating the file
`pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart`, we now need
for the top level variable `fastaAnalyzerErrorCodes` to have type
`List<ErrorCode?>`.

The generated file was updated in
9f986d2501 as part of migrating the
analyzer package to null safety; this updates the code generator so
that when it is re-run in the future we won't lose the change.

Change-Id: I893c1fe6f206d5dfbfebbf7bb80d5a00fc7b56be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182365
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-03 00:02:19 +00:00
Konstantin Shcheglov 0b68104b98 Issue 44840. Add debug information.
Bug: https://github.com/dart-lang/sdk/issues/44840
Change-Id: I7a536db1de0da3144a9b5184373637335da494d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182367
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:25 +00:00