Commit Graph

134 Commits

Author SHA1 Message Date
Paul Berry 6547f741b6 Add language tests illustrating issue #42603.
Bug: https://github.com/dart-lang/sdk/issues/42603
Change-Id: I1d59b7b65d77e5f1accb4f9c3c99e92e48ffb364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153709
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-07-13 18:12:39 +00:00
Paul Berry b91ff153c1 Test various exceptions to variables being considered definitely unassigned.
There are several scenarios in which the flow analysis implementation
needs to be careful to mark variables as "not definitely unassigned",
even though they are not definitely assigned.  These scenarios are
handled by the implementation but not yet properly spec'ed.  Prior to
updating the spec, I wanted to make sure we had adequate test cases.

Change-Id: Id3f82279e0686f9cccfabd834396f05b8b28bcab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153825
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-10 20:14:16 +00:00
Paul Berry fe9596bac3 Add language tests for flow analysis conservative de-promotion scope.
These tests verify the scope over which a variable can become
de-promoted due conservative modeling of demotion.  The conservative
model of demotion is used for loops, closures, switch statements, and
try blocks.

The implementation of flow analysis already passes these tests.  I
will shortly be making a spec clarification that brings the spec in
line with the implementation.

Change-Id: I22a5584a808169fa228c2972c25844c432916c06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152920
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-07-09 22:45:38 +00:00
Nicholas Shahan b524f398c3 [ddc] Add option to run non-null asserts in weak mode
* Setting the nonNullAsserts flag in the bootstrapping logic will
  enable/disable failing when a null value is passed to a non-nullable
  method parameter when running with weak null safety.

* Move the --null-assertions from VM options to the shared options in
  the test and use it to set the flag in DDC the entry point.

* Configure other backends to ignore the flag.

Change-Id: Ia2670514bed7fa981564e99b85d74f6bae6dd9fc
Fixes: https://github.com/dart-lang/sdk/issues/42404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151306
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-07 21:48:40 +00:00
Alexander Markov 7bbf2921db [vm/nnbd] Non-null assertions in NNBD weak mode
Fixes https://github.com/dart-lang/sdk/issues/42357

Change-Id: I07341ba02361201ec2130fb7b6cb87a25b9b5f51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151662
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-18 20:02:42 +00:00
Regis Crelier db29a9697f [tests/NNBD] Fix expectations in normalization test.
This fixes issue https://github.com/dart-lang/sdk/issues/42143

Change-Id: I11df42728f74e85071566b355d1a3bbba4182aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151440
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-06-17 15:51:39 +00:00
Nicholas Shahan ee54a343ba [ddc] Fix type parameters in tear offs
Add missing nullability on type parameters in function types of
tear offs.

Change-Id: If56ab42db57d14d0939a03518d5b944548e4065d
Fixes: https://github.com/dart-lang/sdk/issues/42246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150680
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-06-10 23:49:43 +00:00
Konstantin Shcheglov 3137a91d3c Enable type inference for local variables with initializers of type Never.
Bug: https://github.com/dart-lang/sdk/issues/42205
Change-Id: I7b032734b18fdb86e48270118b4dd91184594e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150474
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-09 17:27:35 +00:00
Leaf Petersen db36f1190f [Language] Various NNBD Tests.
Add a variety of small nnbd tests covering the specification
changes/clarifications landed in
https://github.com/dart-lang/language/pull/1003 .

Change-Id: I0716f14652128323bf103df154efb5bf978091d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150160
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-05 23:53:20 +00:00
Alexander Markov b2756b0580 [tests/nnbd] Remove mixed mode test cases from language/nnbd/subtyping/type_casts_strong_test
Now we cannot have a mix of opted-out and opted-in libraries in
strong mode, so we can remove all test cases for mixing legacy
types with nullables and non-nullable types from type_casts_strong_test.

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

Change-Id: I4a4eb5af732575e9a5b20b0029812852759dd15a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149740
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-02 19:46:38 +00:00
Nicholas Shahan 72e559929f [ddc] Add --sound-null-safety flag and pass to CFE
https://dart-review.googlesource.com/c/sdk/+/149080 is required to
get errors if you try use weak .dill files when passing the
--sound-null-safety flag.

Added a new build target to copy the sound SDK outline .dill to
dart-sdk/lib/_internal. This is only part of dartdevc_test right
now. We will decide in the future if we are going to include this
in the released SDK or if we will have the build systems create
them as needed. For now in testing scenarios it appears to be part
of the SDK.

Change-Id: I3b31a894841f59b437658104e7ee9443ee67db93
Fixes: https://github.com/dart-lang/sdk/issues/41694
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146962
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-29 01:16:18 +00:00
Leaf Petersen 96c23be456 Add tests for runtime type normalization.
Change-Id: Ie71fa6acc1317d6be33cfb45ffed1a0816020806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148582
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-05-21 23:04:45 +00:00
Robert Nystrom 114eea60bb Skip mixed-mode tests under language/nnbd in strong mode.
These tests all are or import legacy libraries, so are no longer
supported in NNBD strong mode. Adding Requirements=nnbd-weak tells the
test runner to skip that test when running in strong mode.

I deleted mixed_bottom_type_strong_test.dart entirely since it seems to
be specific to strong mode but is a legacy library. It is no longer
meaningful and there is already a corresponding weak test.

Change-Id: I5a8ec93114ad29abc3d12e356eeb7bf9efd3e1c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148234
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-05-21 17:34:43 +00:00
Regis Crelier 19f49509b0 [VM/nnbd] The equivalent of dynamic as bound is Object? and not Object.
This is a partial fix for https://github.com/dart-lang/sdk/issues/41939

Let's take one step at a time, but later, we should be able to leave the bound as dynamic, since mutual subtyping of bounds is now implemented.

Change-Id: I57f725ba5b02237a64ae77593f340438f7159ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148515
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-05-19 18:10:54 +00:00
Mark Zhou 3391be2d16 [tests] Adding and extending tests for required named parameters.
Some of these are currently disabled in the CFE. See: https://github.com/dart-lang/sdk/blob/master/pkg/front_end/lib/src/fasta/source/source_library_builder.dart#L403

Change-Id: If5aeff4e3743ea589e8c2572ada869aeced5c826
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144671
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-05-04 21:17:47 +00:00
Johnni Winther e046afac1f [cfe] Don't print nullability on Null in messages
Change-Id: I530d3eef1a0af73d68aaccf33095ab2dcaf4747c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145461
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-30 08:16:24 +00:00
Paul Berry 885de405d2 Add test to validate resolution of #39641.
This test validates my understanding of
https://github.com/dart-lang/sdk/issues/39641#issuecomment-573669413,
namely that when assigning to a promoted variable, the context used to
do inference of the RHS of the assignment should come from the
promoted type, but it should still be ok if the RHS doesn't evaluate
to a subtype of the context type (in which case the assignment
de-promotes).

Change-Id: Iafb2e741f8b9631a9b017804a5ad59972bfc638e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144883
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-04-28 23:28:13 +00:00
Konstantin Shcheglov 46a2086e6c Issue 41479. When terminate null shorting at CascadeExpression, don't make it nullable.
Bug: https://github.com/dart-lang/sdk/issues/41479
Change-Id: I2d843846ca2a0232dbea60ad2b71e745ac118588
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144672
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-04-24 18:45:13 +00:00
Leaf Petersen 6befc18cae Add tests for assignability around Never.
Change-Id: I2d3548eb609743277c026155d70fc1cb4d976cc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143040
Reviewed-by: Erik Ernst <eernst@google.com>
2020-04-24 04:38:43 +00:00
Liam Appelbe 87b829bacd [nnbd] Fix some more strong mode tests
All these tests now pass in both weak and strong mode, except for
relation_subclass_test and typedef_reflected_type_test. For those 2
tests I fixed the compile time error and now they have the same runtime
errors in both weak and strong mode (they were already failing at
runtime in weak mode).

Change-Id: If0157f811fffcf72a12ce6690ac0568c8f4419a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144343
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-22 00:12:24 +00:00
Konstantin Shcheglov 7e4673f497 Check overrides using only direct superinterfaces.
Change-Id: Ib17c3fb18d6ec4ff4541835a78c645a7b13affd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142760
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-21 02:42:04 +00:00
Konstantin Shcheglov eae75026fa Update tests after rename to UNCHECKED_USE_OF_NULLABLE_VALUE.
R=brianwilkerson@google.com

Change-Id: I51544b0955a906920aa80ae30aa9ecbf80294baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144006
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-20 02:39:25 +00:00
Nate Bosch 0416cfd075 Add a static error test for default catch type
Static error test for https://github.com/dart-lang/language/issues/922

If the type of the error argument was `dynamic` there would be no error
for calling a method that does not exist.

If the type of the error argument was `Object?` there would be an error
for the call to `_takesObject`.

Change-Id: I3cec1a8ae2903887e5da086cdeecd4008ef5d667
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143329
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-04-16 20:52:45 +00:00
Konstantin Shcheglov 23a8788f6a Issue 41378. Update on-catch and throw for the spec changes.
Now it is not an error to use a potentially nullable type in on-catch.

But it is an error for throw an expression of type that is not
assignable to Object.

Bug: https://github.com/dart-lang/sdk/issues/41378
Change-Id: If0a198ae618cd01d03f45a46aa1efa6179df76ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-04-11 20:08:03 +00:00
Leaf Petersen b135aab6d7 Fix bad test expectation, convert to static error test
Change-Id: I821dd3af8c1be346d983bd41bb80efefba176cd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143102
Auto-Submit: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2020-04-10 18:07:44 +00:00
Leaf Petersen 9a51d7003d Fix top_merge tests.
Fix several issues causing spurious errors in the top_merge tests and
remove one test file for which there is not a sensible resolution of
the issues.

Change-Id: Ia7fcdc02c0461980bae99cdbdc78bfac18d3efb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142887
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2020-04-10 01:05:41 +00:00
Leaf Petersen e8ff0c884e Add tests for null safety boolean conversion.
Tests for the null safety spec clarification landed in
https://github.com/dart-lang/language/pull/917 .

Change-Id: Ieafe5315c31919c01ff816a26d29fa0d1cbc8c9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142782
Reviewed-by: Erik Ernst <eernst@google.com>
2020-04-10 00:46:06 +00:00
Leaf Petersen 8e5e74e7c9 Test TOP_MERGE on super-interfaces.
Test that TOP_MERGE correctly resolves multiple super-interfaces.

Change-Id: Iba7b4c63cb21ce8ffe1c82b235668c3c3f0f0e05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141847
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-04-08 20:21:08 +00:00
Leaf Petersen 5ba1b3f904 TOP_MERGE member override tests.
Tests for member signature resolution as specified in this change:
https://github.com/dart-lang/language/pull/904

Change-Id: I7ee81dd1927b8f9419082f9bd2cbec14f0a5c0f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142802
Reviewed-by: Erik Ernst <eernst@google.com>
2020-04-08 20:19:52 +00:00
Erik Ernst e2e722463c Adjust member signature expectations for mixed inheritance
The rule NNBD_TOP_MERGE(S*,T) = NNBD_TOP_MERGE(S,T) and the converse
imply that when a legacy member signature and a null-safe member
signature are brought together by two different superinterfaces,
the null-safe signature prevails (so the legacy signature is ignored).

This CL makes adjustments to 'legacy_resolves_conflict_3_test.dart'
to match this. Note that this means that a class like DiB3 has a
member signature `int Function(int) get a` even though it inherits an
implementation with signature `int? Function(int?) get a`, so we may
have to make such classes an error. [Edit: Based on the notion of
a 'class implementation', which is consolidated in the same sense as
the class interface, but which records the concrete member
declarations available in superclasses, with the declaration in the
nearest superclass prevailing over declarations in more remote ones,
the conflict disappears in the usual way: The class implementation
of a legacy class is legacy-erased. So there are no errors for those
classes after all.]

Change-Id: Ie72e6b80064764fa722304f32bee5e9188710a2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142372
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-04-07 12:20:21 +00:00
Leaf Petersen 6cb98c55d5 Add tests for extended GLB.
This adds tests for the specification change from
 https://github.com/dart-lang/language/pull/903


Change-Id: I2344ea32ac1ca51360ed262f761d14e8db7045bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141841
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-04-07 02:57:18 +00:00
Erik Ernst 72e4d14983 Moved several classes with compile-time errors to 3_error_test
Johnni Winther noted that several classes in
'legacy_resolves_conflict_3_lib2.dart' must be flagged as errors,
because they have incorrect override relationships between declarations
in the class and a the member signatures of a direct superinterface.

This CL moves those classes out of
'legacy_resolves_conflict_3_lib2.dart' and into
'logacy_resolves_conflict_3_error_test.dart',
such that they are only in scope in the library that expects compile-
time errors. Adjusted other libraries to stop referring to these
classes, and marked the classes with the expected errors.

Change-Id: Ia40f56efcb3dea17e60652dd8a2bbb892f89e5b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142142
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-04-03 07:02:46 +00:00
Alexander Markov 6e53ac6e4c [vm/nnbd] Fix supertype check in GenerateSubtype1TestCacheLookup
Before calling Subtype1TestCache stub, there was a quick check if
supertype's class id matches tested class id.
Null extends Object, so supertype of Null matches Object.
However, in NNBD strong mode Null is not assignable to Object.

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

Change-Id: Icc3efaf90992b5083cbe086af81db7504724b855
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142085
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-04-02 01:39:10 +00:00
Erik Ernst b177e44ffa Add mixed inheritance tests
Updates Mar 19, for better precision in tests (that is, catching
more bugs):

Added tests where `r.m(null).isEven` is used
to near-verify that the receiver `r` implements `A<int*>`:
With `A<int>` it's an error to pass `null`, and with `A<int?>`
it is an error to invoke `isEven`.

Added '1_error' test to detect that `r.m(null).isEven` is a
compile-time error in cases where the receiver has a different
member signature for `m`.

Added '3_error' test to detect that it is a compile-time error to assign
'D().a' to a specific type, for many `D`. This helps catching the
situation where the member signature of `a` is legacy: if that were
true then this test will fail because there is no error).

Change-Id: If6abafbadb51dcb04d13876b577d15c74bf47ccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139817
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-01 13:18:04 +00:00
Konstantin Shcheglov 4a5e6e649a Update default_list_constructor_test to reflect that any use of the default List constructor is an error.
Change-Id: I97657eb8c44fd07c4940b757d6962534b8276e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140766
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-24 20:01:55 +00:00
Nicholas Shahan 3ae7394979 [tests] Update test expectation methods
`Expect.identical()` --> `Expect.equals()`

The spec defines runtime type object equality but not that they are
identical.

Issue: https://github.com/dart-lang/sdk/issues/41005
Change-Id: I57a0a5da0af18974d4081ea463ec0bff86f7d3e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139843
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-03-17 23:43:05 +00:00
Konstantin Shcheglov 0f8238efe9 Issue 41036. Add null-shorting for prefix/postfix expressions.
Bug: https://github.com/dart-lang/sdk/issues/41036
Change-Id: Iccff235bc81b6e65a3b40f972aaa75707ac2232c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139462
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-16 20:23:16 +00:00
Nicholas Shahan 9301c2f593 [tests] Fix analysis errors in tests
Non-nullable and optional method arguments need default values. Embedded
the generic type argument into a List as an easy way to create a default
value.

Change-Id: Ib171c272c75b114447d356d423c45dc9aeff9bb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139160
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-03-12 18:16:36 +00:00
Nicholas Shahan 33349076ee [tests] Add tests for type object equality after FutrureOr normalization
Change-Id: I61d0b35fff087091eafa921f679a29760b00b84f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138103
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-03-12 01:20:50 +00:00
Leaf Petersen 5e9be81d5e Make all CastErrors be TypeErrors.
This makes CastError implement TypeError, and changes all test
expectations to look for TypeError.  A followup CL will deprecate
CastError.

Bug: https://github.com/dart-lang/language/issues/787
Bug: https://github.com/dart-lang/sdk/issues/34097
Change-Id: I7102c6260901317572d2df08c4be9c4c48197688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138670
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-03-11 23:31:06 +00:00
Konstantin Shcheglov a44f680932 Update assignment in language/nnbd/operator_type_test
Change-Id: I81b87af6bd8ae51d626afb79412730c4bc39204a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138980
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-11 15:09:24 +00:00
Konstantin Shcheglov 0e0cde55a0 Add default values for tests/language/nnbd/type_equality/function_type_equality_test
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I5f1f356e96f66b4b0098fba6ab61109ae5cc3ac5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139026
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-11 15:01:29 +00:00
Konstantin Shcheglov 21cddbd4cf Fix language/nnbd/syntax/late_modifier_error_test
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Icdefdfcae39a496fff6f8cf0b505b0a67a282ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-03-11 15:01:21 +00:00
Konstantin Shcheglov d7f697f64a Include additional analyzer errors in language/nnbd/syntax/class_member_declarations_error_test
Change-Id: Iee4344a65e85890c3361294a6bdaa0920a3a4f10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-03-11 00:45:41 +00:00
Leaf Petersen f34fa57d98 Update null aware subscript test
Change-Id: Ib3a37f575906c125b850fa82732595f1532c9d9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138721
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-03-10 17:41:51 +00:00
Konstantin Shcheglov bbb449dfa4 Issue 40931. Update inference constraint for T? to be non-nullable.
Bug: https://github.com/dart-lang/sdk/issues/40931
Change-Id: I483c3febad236b366f911f38339c712dd928cfcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138790
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-03-10 02:19:50 +00:00
Konstantin Shcheglov 24c8021f03 Replace initialize() with declare().
Fixes https://github.com/dart-lang/sdk/issues/38791

Change-Id: I954059160c75de91e1e32fe2f82ebfdc5569d947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138666
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-03-09 18:24:51 +00:00
Brian Wilkerson 9a62df57fa Fix a test to get the analyzer nnbd bot to pass
Change-Id: I5892c245d4aa984c896471bf18cd71362958d0c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138782
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-09 17:47:47 +00:00
Liam Appelbe 2c5a56e7bb [vm] Disable late field init for constructor initialized fields
Change-Id: Ibdab37839d07b77bf2c92a09f760f44b54d94bcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138620
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-03-06 17:10:08 +00:00
Liam Appelbe 331067017f [vm] Fix late field store bug
Late field stores were being incorrectly marked as initializations,
causing them to be incorrectly optimised out in some cases.

Change-Id: I7487d24238af3b3922e76a9ca6ae6df4bf5ab849
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138566
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-03-05 23:34:16 +00:00