Commit Graph

5559 Commits

Author SHA1 Message Date
Erik Ernst 016ebdd03a Add tests for metadata in all locations, cf. grammar
Change-Id: Ibaa2bcd014257c6ec7c756d352e55d48f8a4a902
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167801
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-10-16 08:19:42 +00:00
Erik Ernst 00a28b5797 Fix test with syntax error
This CL changes `late x;` to `late var x;` in a test. Apparently, this
syntax was considered correct and the front end and analyzer accept it.
However, it is a syntax error, and this CL corrects it. The fact that
the tools accept it is reported as SDK issue #43811.

Change-Id: Iaa2fe56fe99d3702345368a54a7389a59288515c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167804
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-15 21:35:41 +00:00
Johnni Winther 16f7ce8e57 [cfe] Warn on null aware access on this and static members
Closes #43703
Closes #43461

Change-Id: I861462b5fcf31d5459c17cbe1604ce285c359dec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167563
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-15 08:48:33 +00:00
Erik Ernst 7e75ea38a2 Discriminate more precisely in least_upper_bound_function_test, f4
language/least_upper_bound/least_upper_bound_function_test.dart would
succeed if in `f4` the type of `z` were any top type. The type actually
expected is `Object?`. This CL adds some extra steps to `f4` to ensure
that it rejects other top types.

Change-Id: Ie2d042d54e83bf3e9c9db0c432ca32e90c5bbc6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166850
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-12 16:39:02 +00:00
Alexander Markov e9aa232066 Remove remaining tests for bytecode mode
Change-Id: I9690bd8a9bdcf16963424c64c1b80628e50fa28a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166922
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-10-09 22:30:19 +00:00
Paul Berry 8857836b62 Ensure that flow analysis sees the correct type of late-lowered local variables.
Change-Id: Id6f3d2ddff5b1d6b496710103d0b557eaed4dc08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166791
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-09 21:14:07 +00:00
Erik Ernst a369992f4b Corrections in lub tests, cf. #43717, #43720.
The tests least_upper_bound_{futureor,function}_test.dart are corrected:
The expected least upper bound was changed in one case in each test,
because the case matches a rule earlier in the ruleset, so the new rules
are not used in these cases.

Change-Id: I1f5f303ccde10af6084771a90d92d81d636909d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166635
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-09 11:22:46 +00:00
Johnni Winther b2e33ee550 [cfe] Check getter/setter types on top level and extension members
Closes #43714

Change-Id: I07ee20cb3a65758dda2139e965aeb4fb36cf38c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166628
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-09 07:16:06 +00:00
Erik Ernst 2ffa46326b Add test dealing with UP on types involving FutureOr
Cf. spec change https://github.com/dart-lang/language/pull/1254,
commit ae340c7dcc62d375bd8df9fd4cb0d669d84478d2.

Change-Id: I28c950ee37c21e138fb7148950b0404004086eff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166626
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-10-09 07:05:16 +00:00
Johnni Winther 4d1e0378c9 [cfe] Update test expectation for number_operator_error_test
Change-Id: I43cda6ca3f57818f9afb0dd33ae9b040f08f384a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166630
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-09 06:27:16 +00:00
Johnni Winther 5a2a435b6e [cfe] Use combined member signature for override inference.
Closes #43381

Change-Id: Id3ba97d717556f807eac1115e1c3570662cab87c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166240
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 15:29:05 +00:00
Johnni Winther 383b470d39 [test] Update never_runtime_check_nnbd to match new expectations
The test was written when a more disruptive solution for the unsoundness
fix was planned. A more lenient solution was found and the test is updated
accordingly.

Closes #43707

Change-Id: I31936fdc3aa0ae23fddd72c850eca5da50b22352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166620
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-08 15:08:05 +00:00
Erik Ernst 2d92a26cca Test error for -e and ~e when e is potentially nullable
This verifies that the operators `unary-` and `~` do not participate
in null-shorting. Cf. https://github.com/dart-lang/language/issues/1081.

Change-Id: Iba446724f00c1c4aaedb4be4425e69fb52cdb5c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166627
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-10-08 15:01:55 +00:00
Erik Ernst 87dd7c03e1 Add tests for least upper bound spec change #1195
https://github.com/dart-lang/language/pull/1195 changes the UP function
such that it uses the greatest closure with bounded and promoted type
variables, and adjusts the catch-all rules about function types (used
with `Function(int)` and `String` and other "otherwise" cases).

This PR adds tests for the updated rules.

Change-Id: I793b85ceec76105d013c03e8d9bccdd187bb476f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166101
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-10-08 10:49:33 +00:00
Paul Berry e933e91aaa Reland "Flow analysis: promote to non-nullable on initialization"
This is a reland of 6a1c54ec30

Original change's description:
> Flow analysis: promote to non-nullable on initialization
>
> When flow analysis encounters a variable declaration of the form `T? x
> = expr;`, if the type of `expr` is `T`, then the variable is
> immediately promoted to type `T`.
>
> Fixes #43099.
>
> Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
> Bug: https://github.com/dart-lang/sdk/issues/43099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

Bug: https://github.com/dart-lang/sdk/issues/43099
Change-Id: I7530bb0f7c24674a7b500558b89d50b35e045aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166305
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-07 13:14:55 +00:00
Mark Zhou 38667e5667 [dartdevc] Lazily executing deferred types to prevent improper module reordering.
Supercedes the following (reverted/abandoned) CLs:
  * https://dart-review.googlesource.com/c/sdk/+/162383
  * https://dart-review.googlesource.com/c/sdk/+/165149
  * https://dart-review.googlesource.com/c/sdk/+/165782

Fixes https://github.com/flutter/flutter/issues/66859 and https://github.com/flutter/flutter/issues/64011

Thanks to Siggi for this approach!

Change-Id: I8e496fdb938e18252ec8a0cf7232c99ca8c27080
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166127
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-10-06 21:31:33 +00:00
Johnni Winther 4c29f26fc6 [cfe] Report errors in invalid main declarations
Closes #43554
Closes #43556
Closes #43558

Change-Id: Ib3e2b891473f07bad7b4a373152be684095619b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165904
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-05 14:37:33 +00:00
Johnni Winther 5210942512 Fix null_shorting_test
Closes #43607

Change-Id: Id404f01b15db8adca6fcc78b119a0db0a250fa91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165903
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-10-05 12:34:59 +00:00
Mark Zhou 3234534bf9 Revert "[dartdevc] Conserving virtual mixin superclass hierarchies even when marked as deferred"
This reverts commit 17dba76fb5.

Reason for revert: Replacing this change with a new strategy for better module reordering.

Original change's description:
> [dartdevc] Conserving virtual mixin superclass hierarchies even when marked as deferred
>
> Fixes https://github.com/flutter/flutter/issues/66859
>
> Change-Id: I9ca3ae7a312d48192659508f2fa0617c7f85efd9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165149
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Commit-Queue: Mark Zhou <markzipan@google.com>

TBR=sigmund@google.com,nshahan@google.com,markzipan@google.com

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

Change-Id: I02561ab7e4678392ee96a6132b96c7f0a1499a34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165872
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-10-02 23:55:11 +00:00
Mark Zhou 17dba76fb5 [dartdevc] Conserving virtual mixin superclass hierarchies even when marked as deferred
Fixes https://github.com/flutter/flutter/issues/66859

Change-Id: I9ca3ae7a312d48192659508f2fa0617c7f85efd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165149
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-10-01 20:12:20 +00:00
Johnni Winther 428c27aee7 [cfe] Update test expectations
Change-Id: I976edefe060af2e5d8a293ca2f4b2f8e554334b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165600
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-01 11:27:12 +00:00
Clement Skau b4f49dc255 Revert "Flow analysis: promote to non-nullable on initialization"
This reverts commit 6a1c54ec30.

Reason for revert: Triggers test failure:
https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-linux-debug-x64/8247

Original change's description:
> Flow analysis: promote to non-nullable on initialization
>
> When flow analysis encounters a variable declaration of the form `T? x
> = expr;`, if the type of `expr` is `T`, then the variable is
> immediately promoted to type `T`.
>
> Fixes #43099.
>
> Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
> Bug: https://github.com/dart-lang/sdk/issues/43099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

TBR=paulberry@google.com,scheglov@google.com,rnystrom@google.com,johnniwinther@google.com

Change-Id: I8549b48a734f527194ce11d82235b9d5c6e58185
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/43099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165564
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-10-01 08:41:15 +00:00
Konstantin Shcheglov 6a92616f52 Issue 43175. Report IMPLICIT_THIS_REFERENCE_IN_INITIALIZER in AssertInitializer.
Bug: https://github.com/dart-lang/sdk/issues/43175
Change-Id: I23ae1c8d6177e99e634d3b05236c5787a3a95b5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164901
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-01 02:02:31 +00:00
Paul Berry 6a1c54ec30 Flow analysis: promote to non-nullable on initialization
When flow analysis encounters a variable declaration of the form `T? x
= expr;`, if the type of `expr` is `T`, then the variable is
immediately promoted to type `T`.

Fixes #43099.

Change-Id: Ia206fe0d50e2fdd9bdf637e13c85633d8490dbcc
Bug: https://github.com/dart-lang/sdk/issues/43099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163841
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-10-01 01:15:31 +00:00
Paul Berry 4cb5b99718 Fix test expectations in read_error_test
Change-Id: I526d54f6976b28b171bf3c414b93e36dc6da508e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165000
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-01 00:38:25 +00:00
Paul Berry 746409b769 Account for full demotion discarding types of interest.
Demoting a variable back to its declared type discards types of
interest, therefore in order to verify that a type is of interest, we
need to join a demoting path with a non-demoting path so that the type
of interest is preserved.

Change-Id: Ie9c3278936b189120c9f0085f1563ff8062e51db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164800
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-10-01 00:29:55 +00:00
Erik Ernst cd280a3f26 Create test for language issue 1182
Add language/extension_methods/static_extension_resolution_7_test.dart,
testing that the inference of a type argument to an extension method
invocation treats bounded type variables and promoted type variables
as specified, and as discussed in language issue #1182.

Change-Id: I99f358eb82dcce235edb091bc2bae172c2725d39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165022
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-09-30 11:14:34 +00:00
Johnni Winther fc158b1616 [dart2js] Evaluate implicit constants in scope visitor
Change-Id: I2351571a665c8ffff8e9d57649fbf42b483e747b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142983
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-09-29 20:13:08 +00:00
Lasse Reichstein Holst Nielsen 241e9f9b11 Add test for null shortening.
Change-Id: Ica4a36114f487247b1e7a5bf1cd4a8584b3f36df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164326
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-29 15:01:56 +00:00
Paul Berry 2575008f25 Generate "late definitely unassigned" error regardless of nullability
Change-Id: I3c3244cb1042087d31c6e90acc9863369e15ad44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164801
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-09-29 12:38:14 +00:00
Paul Berry c4b56443c5 Update CFE expectation for read_error_test.dart
Change-Id: Idfa1f83929305fbbc3560a1123850a1c785d6537
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164880
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-09-28 23:15:08 +00:00
Paul Berry def50905c2 Make flow analysis handling of is/==/??=/?. consistent with mixed mode semantics
Bug: https://github.com/dart-lang/language/issues/1143
Change-Id: Id177f8b19c15ef246f21ddd840410cddfee2e5cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163600
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-25 08:35:03 +00:00
Brian Wilkerson cd897bc86c Remove the diagnostic default_value_in_function_typed_parameter
This diagnostic is obsolete because the parser also produces a
diagnostic for this situation.

Change-Id: I5c5f7fc734ddeb5cfaaba9cc9980efe174aeb4e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164461
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-09-25 04:35:53 +00:00
Leaf Petersen 041261f92f Add tests for promotion behavior related to variable initialization.
Change-Id: I31d9f245f6dc1f34e13d026c95189f10f4dae75f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163663
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-09-23 00:15:25 +00:00
Erik Ernst ecc87a177f Correct tests with unintended syntax errors
Change-Id: Id33f3088391815686b04f437cbf756b5718ed9bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163664
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-09-22 06:59:43 +00:00
Robert Nystrom 1b04c3f9de Add a language test for #43397.
Change-Id: I756d4f4a768ff08e81fd2b90a6c76d833cc8ba0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163740
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-21 19:32:12 +00:00
Robert Nystrom d5bbfcd874 Update static errors for variance_in_inference_error_test.
These changes look substantive to me, which isn't expected.

Change-Id: Ie4e4fd9d702923b3c3c2fdd56160a523801a6c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162944
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-09-18 11:57:05 +00:00
Robert Nystrom 122f07c7bb Fix mistakes in variance_downwards_inference_test.
Fix #43422.

Change-Id: Ic315148284e45a26cfe88ac6177c16c671a318eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162961
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-09-17 00:15:19 +00:00
Nicholas Shahan 1d34f60b66 [ddc] Fix missing covariant checks from mixins
Collect all forwarding stubs from anonymous mixin classes and insert
them in the target class if no override exists.

Change-Id: Id62f20b644ce7bbabe114d0d1648664392748a2d
Fixes: https://github.com/dart-lang/sdk/issues/43027
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161760
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-09-16 18:56:58 +00:00
Leaf Petersen 623a9bda67 Fix async test to match inference changes from #43162.
Closes #43440 .

Change-Id: If25e49400d63698b974ab935f483804e36e22f98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163040
Auto-Submit: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-09-16 14:39:28 +00:00
Dmitry Stefantsov e119ccad2a [cfe] Infer Object from constraints similar to T? = dynamic
Closes #43163.

Bug: https://github.com/dart-lang/sdk/issues/43163
Change-Id: I55f51eee097a320dcc38cf54a41c9f6684b5dd59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162505
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-09-16 11:36:28 +00:00
David Morgan 8d8df2c9f6 Revert "Issue 43162. Change matching dynamic/void vs. 'T?'."
This reverts commit 7b0aeb2ac8.

Reason for revert: regressions in analysis in legacy mode, see b/168675476

Original change's description:
> Issue 43162. Change matching dynamic/void vs. 'T?'.
> 
> Bug: https://github.com/dart-lang/sdk/issues/43162
> Change-Id: I8ae2166e4bc593b42ddd39c35e7d02a706d7b94d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162621
> Reviewed-by: Leaf Petersen <leafp@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=leafp@google.com,scheglov@google.com,brianwilkerson@google.com,srawlins@google.com

Change-Id: I288f8ccf82c17565c40e02245998590ebd7c98bc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/43162
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162747
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-09-16 07:36:05 +00:00
Konstantin Shcheglov 7b0aeb2ac8 Issue 43162. Change matching dynamic/void vs. 'T?'.
Bug: https://github.com/dart-lang/sdk/issues/43162
Change-Id: I8ae2166e4bc593b42ddd39c35e7d02a706d7b94d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162621
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-16 02:31:02 +00:00
Johnni Winther 4948c31b7a [test_runner] Support detection of CFE warnings
+ some test expectation fixes

Change-Id: Ibf0259914960ea25978f2b8e29aa89336e209f2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162321
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-15 07:57:31 +00:00
Nicholas Shahan cdd1260ef0 [tests] Move regression test to run on all backends
This same error recently surfaced on a flutter web target.

Change-Id: If4c093cde85887105e93ab46469b1c3b2ea55d03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162243
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-09-14 21:13:37 +00:00
Mark Zhou 9ea431c158 Simplifying and recategorizing cyclic imports test
This bug doesn't depend on exports and instead of the constructed class hierarchy.

See: https://dart-review.googlesource.com/c/sdk/+/162383/comment/9196db98_412d446d/
Change-Id: Ib107d3fa3ab7782bee5db59754583b20976832a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162785
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-09-14 20:20:49 +00:00
Paul Berry 343148f60a More test cases for never_runtime_check.
These test cases cover the following scenarios:

- `is` and `is!` tests that do not appear inside an "if" statement.

- `== null` and `!= null` tests that do not appear inside an "if"
  statement.

- `??=` assignment where the "write" type is nullable but the "read"
  type is non-nullable (to make sure the implementation is using the
  read type to decide whether to insert the null check).

- `??=` assignment where the LHS is a super call to the index operator.

- `??=` assignment where the LHS is accessed through an extension
  (either explicitly or implicitly).

- `??=` assignment where the LHS is a null-aware indexed operator.

- Null-aware access to a getter.

- Null-aware access via a cascade.

- Null-aware access to a method/getter on Object (e.g. `toString()`).

- Null-aware access to a method/getter supplied by an extension that
  extends a nullable type (either explicitly or implicitly).

Change-Id: I46aeb6ffc35fc776f48bcd838ff8e4acf7b39f05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162629
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-09-14 19:53:37 +00:00
Regis Crelier 27235bf480 [VM/runtime] Fix finalization of recursive types.
Super type's type arguments that are still unfinalized after instantiation during finalization are not necessarily `TypeRef`, but can be (recursive) `Type`.
Add regression test.

This fixes flutter issue https://github.com/flutter/flutter/issues/65278

Change-Id: I07f842d798d24ebff9d1462d7e47278e901c0128
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162583
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-09-14 18:52:43 +00:00
Mark Zhou 53895b2270 [dartdevc] Fixing issue related to dual exports of multiple entrypoints in a cyclic import loop.
See: https://github.com/flutter/flutter/issues/64011
Change-Id: I8a11e9d3f19428a516cf7a60ee45c3bacf26545d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162383
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-09-14 18:49:00 +00:00
Jens Johansen e6ffc0b285 [parser] Issue different warnings for missing identifier based on whether the token is used or not.
E.g. "var = 42;" now has a different error message than "var default = 42;".

Fixes #22553

Change-Id: I58affe988569d8e79190b63f7267b471a1b0ebc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162182
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-14 08:55:18 +00:00