mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 14:53:37 +00:00
556f0fb5c8
This change only affects compilation when running in non-precompiled mode with --no-lazy-dispatchers enabled. Instead of always compiling in non-covariant checks, even for closures not called dynamically, remove the non-covariant checks from the closure and instead do the non-covariant checks for dynamic calls during the NoSuchMethodForCallStub fallback by calling Function::DoArgumentTypesMatch. Adds two overloads for Function::DoArgumentTypesMatch, one which takes a function type argument vector and one which takes neither an instantiator type argument vector or a function type argument vector. For the versions that are not explicitly passed a type argument vector, an appropriate one is constructed using the arguments. If there is not enough information in the arguments, then we fall back to assuming the empty type argument vector for the instantiator case and instantiating to bounds in the function type argument case. Fixes Function::DoArgumentTypesMatch to handle generic functions and to check arguments appropriately according to the active null safety mode. For generic functions, the provided or resulting function type vector has non-covariant checks performed against the type parameter bounds. This change uncovered one test that was incorrectly passing in strong mode, see https://github.com/dart-lang/sdk/issues/42688 for details. Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-dartkb-linux-release-x64-try Change-Id: I5030a46b356778448b51a243f16406eacf1c04bf Bug: https://github.com/dart-lang/sdk/issues/40813 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153202 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Régis Crelier <regis@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
api_readme.md | ||
BUILD.gn |