Johnni Winther
38d7c7661d
[cfe] Special case Null in assignability errors.
...
In error reporting on assignability where the expression has type
`Null` we use a special messages that doesn't state that
"'Null' is nullable". Cases where `Null` is part of the type or where
the expression of type `Null` is derived from a collection are not
special cased.
Closes #43998
Closes #44093
Change-Id: Ic0c79e6362f2365eb3fe8222ccd2ef8fac4f188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170433
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-11-09 11:07:44 +00:00
Erik Ernst
35d83867ba
Enable non-function type alias tests for the analyzer
...
Change-Id: I64074eb4b49e514f3b7454de0fb244f21ef336a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Erik Ernst <eernst@google.com >
2020-11-06 08:19:52 +00:00
Erik Ernst
3a7eeb6315
Rename is{Strong,Weak}Mode to has{Sound,Unsound}NullSafety
...
Change-Id: If3912d75c5f89a741299b2fae4299d01ac928eec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170424
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
Reviewed-by: Michael Thomsen <mit@google.com >
Reviewed-by: Mayank Patke <fishythefish@google.com >
Commit-Queue: Erik Ernst <eernst@google.com >
2020-11-05 14:26:53 +00:00
Brian Wilkerson
3fe3a0384f
Improve the highlight range for invalid_super_invocation
...
Change-Id: I8be664802f04def78304b7cc0e8481d734d295e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-11-01 15:24:51 +00:00
Ryan Macnak
88fdb3ee68
Add tests for the identity of constants repeated in different loading units but not present in the main unit.
...
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I29a00aa6139dc2a1f865f8c5f659169c84c8e45d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169790
Reviewed-by: Régis Crelier <regis@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2020-10-30 19:16:42 +00:00
Johnni Winther
5efe55abf7
[cfe] Fix missing case of using receiver type instead of bound
...
+ fix test to expect erasure of `S & int` to `S` also when bound is `dynamic`.
Closes #43591
Change-Id: I44cb4c726648d4065bdf89bb2dbf71b2753c6c84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169340
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
2020-10-30 16:33:51 +00:00
Erik Ernst
0cf3c37e9e
Adjust tests verifying the static type dynamic
...
Change-Id: Icf229e3877ce646340b6dad1bd49c20110953d44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169885
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Erik Ernst <eernst@google.com >
2020-10-30 16:10:30 +00:00
Leaf Petersen
a6faf8f2f9
[Language] Enable null safety in Dart 2.12.
...
Closes https://github.com/dart-lang/sdk/issues/22
Change-Id: I662dd17fda0ff62a871314896fbf1dbe220f41de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166790
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Leaf Petersen <leafp@google.com >
2020-10-29 18:25:56 +00:00
Johnni Winther
13704520a0
[cfe] Indicate nullability as assignability issue when appropriate
...
Closes #43592 .
Bug: https://github.com/dart-lang/sdk/issues/43592
Change-Id: Ib57a70526a39a7125238546f08e1a2e97c279f0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168860
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-10-29 16:10:03 +00:00
Erik Ernst
d459f2244a
Enable non-function type alias tests for CFE based tools
...
Change-Id: I794b18ee8e8b87e692889614a062132fcf1f010a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169641
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Erik Ernst <eernst@google.com >
2020-10-29 13:40:23 +00:00
Lasse Reichstein Holst Nielsen
8abf6c67ad
Add test of potentially constant scopes.
...
Tweaks.
Change-Id: I0fb8b4088c86e5b83f1c76db8a2dfa7c9023c1b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99000
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
2020-10-29 10:11:53 +00:00
Clement Skau
c486a07b02
[VM] Fixes yield* exception handling in sync*.
...
This adds a mechanism similar to that used in async functions where
exceptions are caught in the synthetic code and passed into the
generated body to be rethrow'n.
This ensures the exception is throw'n from the same place as the
original yield*, as per the spec.
Bug: https://github.com/dart-lang/sdk/issues/42466
Change-Id: I054b9db568a49b046b6bb49f3e775bf093f83950
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160221
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2020-10-27 06:46:27 +00:00
Brian Wilkerson
6b3f3403ec
Unify three diagnostic codes for documentation purposes
...
Change-Id: I46326160fedb26c92843698dd6513b9fe87e32dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169041
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2020-10-26 04:24:55 +00:00
Jens Johansen
5a6129406f
[parser] Consistently disallow 'late' without 'var', 'final' or type
...
Fixes https://github.com/dart-lang/sdk/issues/43811
Fixes https://github.com/dart-lang/sdk/issues/43812
Fixes https://github.com/dart-lang/sdk/issues/43813
Change-Id: I39de527883d33459694ec0f91b769676eb52d54b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168641
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-10-23 06:28:51 +00:00
Jens Johansen
9b28b6e503
[tests] Add const-big-set-literal test
...
Const version of regression test for #43756
Change-Id: Ie21be7985e420290cf1c286fd299d5e8962f757e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168483
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2020-10-20 11:07:23 +00:00
Erik Ernst
a917cae88c
Add further cases to metadata test
...
Adding static methods/getters/setters to class/mixin/extension,
instance getters/setters/operators to mixin/extension, new-syntax
type alias.
Change-Id: I4e3f168d8db9c5f168b138c847bccf948c05c567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168080
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
Commit-Queue: Erik Ernst <eernst@google.com >
2020-10-19 16:10:08 +00:00
Jens Johansen
bf46063e16
[tests] Add big-set-literal tests
...
Regression test for #43756
Change-Id: Iaf2cca5ae5440d3604c8c3311ad443f63355dc33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168340
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2020-10-19 09:23:26 +00:00
Paul Berry
f0052ef52e
Add cycle detection test cases for nonfunction type aliases.
...
Change-Id: I4375c3374ba5d51b4431dbe22a0e8c867a4eb03d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167720
Reviewed-by: Erik Ernst <eernst@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-10-16 23:13:42 +00:00
Alexander Markov
dea3fa7b8c
[vm/compiler] Allocation sinking of arrays and typed data objects
...
JIT mode: ParticleSystemUpdate +44-52%
JIT mode with null safety: ParticleSystemUpdate +40-44%
In AOT mode a few methods from package:vector_math are not inlined
in ParticleSystemUpdate benchmarks, which prevents allocation
sinking optimization.
Closes https://github.com/dart-lang/sdk/issues/43228
Change-Id: I28d5816e643e4cfffe4b4fb7db5db5a3aa72499c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164805
Commit-Queue: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
2020-10-16 20:05:02 +00:00
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