mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
6239c434fb
Elimination of redundant type cast 'x as Function' where x is a function type (such as 'void Function(int)') is not correct because it changes semantics of a function call if such expression is used as a receiver. "Function" static type of receiver allows arbitrary function calls, while known function type of the receiver means the call doesn't need to check parameter types. Static type of receiver is currently not stored in kernel AST but calculated from the receiver node, so replacing 'x as Function' with 'x' changes static type of the receiver from "Function" to function type. TEST=tests/language/regress/regress45428_test.dart Fixes https://github.com/dart-lang/sdk/issues/45428 Change-Id: If7148450526703daa63a442adf67a9e7a2dcea54 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193524 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com> |
||
---|---|---|
.. | ||
co19 | ||
co19_2 | ||
corelib | ||
corelib_2 | ||
dartdevc | ||
dartdevc_2 | ||
ffi | ||
ffi_2 | ||
language | ||
language_2 | ||
lib | ||
lib_2 | ||
modular | ||
standalone | ||
standalone_2 | ||
web | ||
web_2 | ||
legacy_status_dart2js.csv | ||
README.md |
This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.