blob: a4f41b50b6e2e3e738de46171f907da666ca7629 [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
typedef Function2<S extends core::Object, T extends core::Object> = (S) T;
static method test() void {
{
(core::int) core::String l0 = (core::int x) core::Null => null;
(core::int) core::String l1 = (core::int x) core::String => "hello";
(core::int) core::String l2 = let final dynamic #t1 = (core::String x) → core::String => "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:15:66: Error: A value of type '(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::String'.\n l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=String*/ (String x) =>\n ^";
(core::int) core::String l3 = (core::int x) core::String => let final dynamic #t2 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:18:77: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n l3 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=String*/ (int x) => 3;\n ^";
(core::int) core::String l4 = (core::int x) core::String {
return let final dynamic #t3 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:20:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n return /*error:RETURN_OF_INVALID_TYPE*/ 3;\n ^";
};
}
{
(core::int) core::String l0 = (core::int x) core::Null => null;
(core::int) core::String l1 = (core::int x) core::String => "hello";
(core::int) core::String l2 = (core::int x) core::String => let final dynamic #t4 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:29:13: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n 3;\n ^";
(core::int) core::String l3 = (core::int x) core::String {
return let final dynamic #t5 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:31:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n return /*error:RETURN_OF_INVALID_TYPE*/ 3;\n ^";
};
(core::int) core::String l4 = (core::int x) core::String {
return let final dynamic #t6 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:34:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n return /*error:RETURN_OF_INVALID_TYPE*/ x;\n ^";
};
}
{
(core::int) core::List<core::String> l0 = (core::int x) core::Null => null;
(core::int) core::List<core::String> l1 = (core::int x) core::List<core::String> => <core::String>["hello"];
(core::int) core::List<core::String> l2 = let final dynamic #t7 = (core::String x) → core::List<core::String> => <core::String>["hello"] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:42:72: Error: A value of type '(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::List<dart.core::String>'.\nTry changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::List<dart.core::String>'.\n l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=List<String>*/ (String\n ^";
(core::int) core::List<core::String> l3 = (core::int x) core::List<core::String> => <core::String>[let final dynamic #t8 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:46:58: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3\n ^"];
(core::int) core::List<core::String> l4 = (core::int x) core::List<core::String> {
return <core::String>[let final dynamic #t9 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:50:52: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3\n ^"];
};
}
{
(core::int) core::int l0 = (core::int x) core::int => x;
(core::int) core::int l1 = (core::int x) core::int => x.{core::num::+}(1);
(core::int) core::String l2 = (core::int x) core::String => let final dynamic #t10 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:60:13: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.\nTry changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.\n x;\n ^";
(core::int) core::String l3 = (core::int x) core::String => (let final dynamic #t11 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:63:14: Error: The method 'substring' isn't defined for the class 'dart.core::int'.\nTry correcting the name to the name of an existing method, or defining a method named 'substring'.\n .substring(3);\n ^") as{TypeError} core::String;
(core::String) core::String l4 = (core::String x) core::String => x.{core::String::substring}(3);
}
}
static method main() dynamic {}