VM: return type not taken into account when checking function type assignability #6029
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
closed-as-intended
Closed as the reported issue is expected behavior
This issue was originally filed by [email protected]
see co19 test Language/10_Expressions/09_Function_Expressions_A03_t02:
typedef bool foo(int x, int y, [double a, double b]);
main() {
foo f;
checkTypeError( () {f = (int x, int y, [double a, double b]) => 1;});
}
According to spec Ch. 11.9, static type of a function literal includes information about static type of the return expression, so this assignment should result in a type error.
The text was updated successfully, but these errors were encountered: