Commit Graph

15 Commits

Author SHA1 Message Date
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
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
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
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
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
Régis Crelier 21bc1ed76c [VM/nnbd] Allow instantiation of a non-nullable type parameter to a nullable type.
Change-Id: Icc3413cd5c285fa40ee5188f39837625d78b9e67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137427
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-27 19:48:23 +00:00
Alexander Markov 77e1c72d04 [vm/nnbd] Type testing stubs in NNBD strong mode
Issue: https://github.com/dart-lang/sdk/issues/38845
Change-Id: I82e7a1b3c4220abdd2a215529230fbb158adbe9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135627
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-02-27 04:36:24 +00:00
Mark Zhou 781cd94279 [tests] Adding test for recursive legacy class type bounds.
See fix: https://dart-review.googlesource.com/c/sdk/+/136724

Change-Id: I85b005898579c1c6fe6904e590e13cc20f754fee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136820
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-02-27 00:06:20 +00:00
Liam Appelbe 05d2586099 [nnbd] Fix analyser error in required params test
Bug: https://github.com/dart-lang/sdk/issues/40781
Change-Id: Id5eefd844ac80c48b8558ead859adb451eb9fcb4
Fixes: https://github.com/dart-lang/sdk/issues/40781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137320
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2020-02-26 17:43:27 +00:00
Liam Appelbe 9e03c2c506 [vm] Add required flag to parameters, and implement subtyping rules.
This CL only covers AST mode, and doesn't address function resolution.

Bug: https://github.com/dart-lang/sdk/issues/39755
Change-Id: I19280fb0d373aa9eb17da13677fd5bb1230385da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131701
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-02-26 00:38:54 +00:00
Nicholas Shahan 69d481065b [tests] Add tests for generic function type bounds with null safety
Testing that type arguments bounded by legacy types are equivalent
with nullable and non-nullable versions of the same types.

Re-landing this change with preapprovals for the VM configurations that
failed the last time.

Change-Id: Ic1709033dc3f3d9d7fc08357c0ad29bf976ed06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134867
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-11 22:31:55 +00:00
Nicholas Shahan f831f121d7 Revert "[tests] Add tests for generic function type bounds with null safety"
This reverts commit 21535e540f.

Reason for revert: VM test bots are failing and the approval system is down so I can't turn them green again. Reverting until I can approve the failures.

Original change's description:
> [tests] Add tests for generic function type bounds with null safety
> 
> Testing that type arguments bounded by legacy types are equivalent
> with nullable and non-nullable versions of the same types.
> 
> Change-Id: Ibd1166af68a74041920940789464cbb8afb091ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132969
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Bob Nystrom <rnystrom@google.com>
> Reviewed-by: Erik Ernst <eernst@google.com>

TBR=leafp@google.com,rnystrom@google.com,eernst@google.com,nshahan@google.com

Change-Id: Iad45fcd1498bdd46bfb908cd40df7ca38ef47d2d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134461
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2020-02-05 00:58:27 +00:00
Nicholas Shahan 21535e540f [tests] Add tests for generic function type bounds with null safety
Testing that type arguments bounded by legacy types are equivalent
with nullable and non-nullable versions of the same types.

Change-Id: Ibd1166af68a74041920940789464cbb8afb091ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132969
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-04 22:37:35 +00:00
Sigmund Cherem 89fb48c648 add mixed subtype test
Change-Id: I4d21d7fae09dd4ed861e560d53fec7b86ed01173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133141
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-01-24 18:43:29 +00:00