The optimizer uses the "is more specific than" relation to eliminate type tests.
In strong mode, the "is more specific than" relation is supposed to be identical
to the "is subtype of" relation. However, it is not quite true, and this is the
cause of this bug. In non-strong mode (Dart 1), the "is more specific than"
relation uses covariance for both result type and parameter types of functions.
In strong mode, we need covariance of result type and contravariance of
parameter types.
Added regression test and updated status files.
Change-Id: I6315643890db75213af6720aa99d8da7b15f99d6
Bug:
Reviewed-on: https://dart-review.googlesource.com/29900
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Fixes#31586.
Note that none of the back-ends handle Instantiation nodes yet, so the
language_2 tests added in this CL
(instantiate_tearoff_after_contravariance_check_test,
instantiate_tearoff_of_call_test, and instantiate_tearoff_test) fail
pretty much across the board right now.
Includes two fixes to Instantiation.getStaticType and the kernel type checker:
- Previously, they attempted to perform substitution on the full
function type, which had no effect because the type parameters were
bound.
- The type checker was not checking that type parameter bounds were
satisfied.
Note that the front end doesn't yet check that type parameter bounds
are satisfied by the inferred type parameters. I will address that in
a follow-up CL.
Change-Id: Ib0ad7a5fc5f4a2fdc8c99abe1f2d3d15b21a4974
Reviewed-on: https://dart-review.googlesource.com/29744
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
- frontend specific tests are moved to old_frontend/
- mirror specific tests are moved to mirrors/
- inference specific tests are moved to inference/
old_frontend/ and mirrors/ will be deleted with the old frontend
- possibly port some of the tests to the new frontend.
Change-Id: I5141238939944c49824f4abb886593f4f8443a94
Reviewed-on: https://dart-review.googlesource.com/29860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The analyzer used to emit a warning when a type parameter to a generic
method was used in an "is" check. This warning was there to help
users write code that worked correctly on both Dart 1.0 and 2.0. Now
that 2.0 generic methods are being more broadly supported and used,
this warning is blocking further library work, and is being removed.
Fixes https://github.com/dart-lang/sdk/issues/30530
Bug:
Change-Id: I70395305ad082aee3072b5beeb0b1b7f7883391b
Reviewed-on: https://dart-review.googlesource.com/29821
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
These members were defined as returning Future<Socket>, but the
implementation in _Socket didn't conform to the interface. There's no
reason these members need to return Future<Socket> anyway, so just
change them to return Future<dynamic>.
Avoids a strong mode error in socket_patch.dart.
Change-Id: Icdda5c7880daf0241e36f1d35e61d171f1694409
Reviewed-on: https://dart-review.googlesource.com/29741
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
During fasta parser recovery, the offset and/or length of some
synthetic tokens was incorrect. This caused problems during
code completion.
Change-Id: Iace73d06bb5da3ae916c69b7823367d8fc6e16b8
Reviewed-on: https://dart-review.googlesource.com/29822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
As reported in SDK issue #30068, co19/**/mouseOverEvent_A01_t01 is
flaky. This CL adds the flaky status for that test also on chrome.
Change-Id: I02dcdce69161a88661bed392bb5e3650893f3315
Reviewed-on: https://dart-review.googlesource.com/29802
Reviewed-by: Erik Ernst <eernst@google.com>
Gardening, reported as SDK issue #31659.
Change-Id: Ic261cf0a10602f0084a52c3201150c79606fdc55
Reviewed-on: https://dart-review.googlesource.com/29780
Reviewed-by: Erik Ernst <eernst@google.com>
Divide the heap by pages into k tasks. Use ThreadBarrier to ensure
planning -> sliding and non-stack forwarding -> stack forwarding.
Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: I2c9fcec0a0794bfea96ca1a0fb509a9f93242b65
Reviewed-on: https://dart-review.googlesource.com/29444
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Erik Corry <erikcorry@google.com>
all satisfactory infrastructurally, organizationally, performance wise.
This does not handle summarizing errors so that we can produce them for existing
dill files, and some other places where special analysis is performed like on
the standard libs.
The CompilationMessage object is less rich than the Message object that other
code is using, see \#31644. However, workarounds included.
Bug:
Change-Id: I5b436b0de6051877801c1d128f43a9656df1b549
Reviewed-on: https://dart-review.googlesource.com/29400
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
- Fix kernel invocation via ddc/ddw tools
- Remove sdk_expected_errors file - it's often out of date
Change-Id: I07bc073e7ebaffd39ff31b9438fd632e14aeac73
Reviewed-on: https://dart-review.googlesource.com/29640
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
Change-Id: I3f90979fad2681775cae56d499f3ff5968ea6485
Reviewed-on: https://dart-review.googlesource.com/29545
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
* Also enable --limit-ints-to-64-bits for CFE when it is used to generate
kernel for VM as CFE relies on int.parse being able to parse correct
literals and reject incorrect.
Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: I4d12057457869e86945a4d3cf83326be7c93c17f
Reviewed-on: https://dart-review.googlesource.com/29546
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Add a new handleInterpolationExpression fasta parser event
so that AstBuilder can correctly construct interpolation expressions
with left and right brackets.
Change-Id: Icca977067fe3a28dbab83488108c7286ec135dca
Reviewed-on: https://dart-review.googlesource.com/29541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>