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>
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>
Without strong mode, a "good enough" implementation is to simply call
the generic method with "dynamic" for the type arguments, which is what
this does. That should be enough to unblock our internal users.
We also need to not report a compile error when
dart_internal/extract_type_arguments.dart imports the hidden
"dart:_internal" library.
This patch does both of those for the VM and dart2js (using its old
front end).
Note that the test still fails because the test is more particular than
most actual user code would be -- it validates that the instantiated
type arguments are *exactly* correct, and not that the returned object
is merely subtype compatible.
Bug:
Change-Id: I0343beace4991861b29712b3fd7067ec8dc8f8ba
Reviewed-on: https://dart-review.googlesource.com/28020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This CL normalizes all status files by the status file normalizer found at
pkg/status_file/bin/normalize.dart.
To make sure all status files are kept in pristine condition, a linter is placed
on the presubmit hook. The linter can be found at pkg/status_file/bin/lint.dart.
Bug:
Change-Id: I20bdb74824be65f079b8c9ab08b7ae38394d637f
Reviewed-on: https://dart-review.googlesource.com/24112
Commit-Queue: Morten Krogh-jespersen <mkroghj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This CL fixes type inference of closures using '=>' syntax so that
they infer consistently with an equivalent closure defined using block
syntax ('{}').
Fixes#31436.
Change-Id: I5463dd0ba986e9953ebabbc24ce3ced9a7220007
Reviewed-on: https://dart-review.googlesource.com/27084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
When an implicit cast can be proven by the front end to always fail,
due to the form of the expression being cast, the front end now
reports this as a compile-time error. (This feature is not new--it is
part of the analyzer's implementation of strong mode).
Newly failing tests are marked with issue #31537.
Change-Id: Ib3fc068352bb91dd283fa4b81d8104fa213eafe9
Reviewed-on: https://dart-review.googlesource.com/26420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Fixes#21938 (Front end does not warn on function calls on Object).
A small number of tests begin failing with this change--these tests
have been marked with issue #31533 for later triage.
Change-Id: I3a956410a6780772fe90098d8604fb10718504df
Reviewed-on: https://dart-review.googlesource.com/26045
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Note that there are currently some inconsistencies between how
function expressions are inferred depending whether they are defined
using `{}` or `=>` (see issue #31436). This CL preserves the existing
inconsistencies. Once we decide how we want to resolve issue #31436,
I'll revisit this code to ensure that it is still correct.
Change-Id: I3926a4b3dc51155d8f03adaae380b50aab39ca60
Reviewed-on: https://dart-review.googlesource.com/24622
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Note that this CL makes a minor change outside of type inference: it
changes the BodyBuilder so that when it desugars a for-in loop that
assigns to a variable declared elsewhere, the desugared assignment is
expressed using shadow objects; this is necessary to ensure that the
type inference engine can walk the desugared assignment and insert an
implicit downcast if necessary.
Change-Id: I4d87f83b8a4b3b72e7ba8042ccd711f0d012fac0
Reviewed-on: https://dart-review.googlesource.com/24340
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
A test introduced in https://dart-review.googlesource.com/c/sdk/+/21080
still did not have the correct expectations for the VM precompiler.
The test was marked as crashing except on arm and simarm64, but it does not
crash on x64 except in debug mode. (I'm not actually sure that it crashes
in all the other configurations that we say it crashes in, but it definitely
does not crash in x64 release or product modes.)
Bug:
Change-Id: I25a8f3cf6cb91cf128cd715d1aaeca2e87d26be4
Reviewed-on: https://dart-review.googlesource.com/22080
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Also, --limit-ints-to-64-bits is enabled when running tests in _2 test
suites.
This is the re-landing of 92ebd8aefa with
fixes:
* Revert changes in pkg/dev_compiler/test/browser/language_tests.js
and tests/language/language_dart2js.status as they describe
'language' test suite, not 'language_2'
* Correct tests/standalone_2/io/fuzz_support.dart as file_fuzz test was
timing out on Windows and failing on android/arm.
Closes https://github.com/dart-lang/sdk/issues/31396
Change-Id: If9ca77fca300ddc605f17a7be39d1707e9724e25
Reviewed-on: https://dart-review.googlesource.com/21700
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
All dartk/dartkp status live in langauge_2_kernel and there is no overlap from the other files.
Change-Id: Iba6dd894829470c59d5894eb0885fb2f6d4ec02e
Reviewed-on: https://dart-review.googlesource.com/21521
Reviewed-by: Paul Berry <paulberry@google.com>
- specify $strong in _kernel.status
- move status entries to the file they belong to (dartk/dartkp in
_kernel.status, none & app_jit in vm.status, dart_precompiled in
_precompiled.status)
Later: merge sections together (many expressions are equivalent or have
conditions that might not be relevant, like $strong && $checked).
Change-Id: Ia16817c2145f002ca210a218759c36c53bbe9ba9
Reviewed-on: https://dart-review.googlesource.com/21220
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: William Hesse <whesse@google.com>
The front end only detects invalid assignments during type inference,
and type inference is only done in strong mode. In strong mode,
invalid assignment is an error.
Change-Id: I1c598716be84804e9dc109414fe45f73888ed8c0
Reviewed-on: https://dart-review.googlesource.com/20741
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>