| library; | |
| // | |
| // Problems in library: | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:88:24: Error: Not a constant expression. | |
| // const int call_dyn = dyn.toString(0); | |
| // ^^^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:88:28: Error: Method invocation is not a constant expression. | |
| // const int call_dyn = dyn.toString(0); | |
| // ^^^^^^^^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:151:34: Error: Not a constant expression. | |
| // const int call_localFunction = localFunction(); | |
| // ^^^^^^^^^^^^^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:156:22: Error: Not a constant expression. | |
| // const int call_f = f(); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:161:23: Error: Not a constant expression. | |
| // const bool equals = i == j; | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:72:42: Error: Can't use an expression of type 'Function?' as a function because it's potentially null. | |
| // - 'Function' is from 'dart:core'. | |
| // Try calling using ?.call instead. | |
| // nonNullableClass2.nullableFunctionField(); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:73:43: Error: Can't use an expression of type 'Function?' as a function because it's potentially null. | |
| // - 'Function' is from 'dart:core'. | |
| // Try calling using ?.call instead. | |
| // nonNullableClass2.nullableFunctionGetter(); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:74:47: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null. | |
| // Try calling using ?.call instead. | |
| // nonNullableClass2.nullableFunctionTypedField(); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:75:48: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null. | |
| // Try calling using ?.call instead. | |
| // nonNullableClass2.nullableFunctionTypedGetter(); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:78:50: Error: Too many positional arguments: 0 allowed, but 1 found. | |
| // Try removing the extra positional arguments. | |
| // nonNullableClass2.nonNullableFunctionTypedField(0); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:79:51: Error: Too many positional arguments: 0 allowed, but 1 found. | |
| // Try removing the extra positional arguments. | |
| // nonNullableClass2.nonNullableFunctionTypedGetter(0); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:82:18: Error: Method 'method' cannot be called on 'Class1?' because it is potentially null. | |
| // - 'Class1' is from 'pkg/front_end/testcases/none/method_invocation.dart'. | |
| // Try calling using ?. instead. | |
| // nullableClass1.method(0); | |
| // ^^^^^^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:106:21: Error: The method 'unresolved' isn't defined for the type 'Class1'. | |
| // - 'Class1' is from 'pkg/front_end/testcases/none/method_invocation.dart'. | |
| // Try correcting the name to the name of an existing method, or defining a method named 'unresolved'. | |
| // nonNullableClass1.unresolved(); | |
| // ^^^^^^^^^^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:109:27: Error: Too few positional arguments: 1 required, 0 given. | |
| // nonNullableClass1.method(); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:110:26: Error: Too few positional arguments: 1 required, 0 given. | |
| // nonNullableFunctionType(); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:136:19: Error: Can't use an expression of type 'Function?' as a function because it's potentially null. | |
| // - 'Function' is from 'dart:core'. | |
| // Try calling using ?.call instead. | |
| // nullableFunction(0); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:137:20: Error: Method 'call' cannot be called on 'Function?' because it is potentially null. | |
| // - 'Function' is from 'dart:core'. | |
| // Try calling using ?. instead. | |
| // nullableFunction.call(0); | |
| // ^^^^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:138:23: Error: Can't use an expression of type 'int Function(int)?' as a function because it's potentially null. | |
| // Try calling using ?.call instead. | |
| // nullableFunctionType(0); | |
| // ^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:139:24: Error: Method 'call' cannot be called on 'int Function(int)?' because it is potentially null. | |
| // Try calling using ?. instead. | |
| // nullableFunctionType.call(0); | |
| // ^^^^ | |
| // | |
| // pkg/front_end/testcases/none/method_invocation.dart:142:27: Error: Too few positional arguments: 1 required, 0 given. | |
| // nonNullableClass1.method().method(0); | |
| // ^ | |
| // | |
| import self as self; | |
| import "dart:core" as core; | |
| class Class1 extends core::Object { | |
| synthetic constructor •() → self::Class1 | |
| : super core::Object::•() | |
| ; | |
| method method(core::int o) → core::double | |
| return 0.5; | |
| } | |
| class Class2<T extends core::Object? = dynamic> extends core::Object { | |
| covariant-by-class field self::Class2::T% field; | |
| field core::Function nonNullableFunctionField; | |
| field core::Function? nullableFunctionField = null; | |
| field () → void nonNullableFunctionTypedField; | |
| field () →? void nullableFunctionTypedField = null; | |
| constructor •(initializing-formal self::Class2::T% field, initializing-formal core::Function nonNullableFunctionField, initializing-formal () → void nonNullableFunctionTypedField) → self::Class2<self::Class2::T%> | |
| : self::Class2::field = field, self::Class2::nonNullableFunctionField = nonNullableFunctionField, self::Class2::nonNullableFunctionTypedField = nonNullableFunctionTypedField, super core::Object::•() | |
| ; | |
| method call() → self::Class2::T% | |
| return this.{self::Class2::field}{self::Class2::T%}; | |
| method method(core::int o) → self::Class2::T% | |
| return this.{self::Class2::field}{self::Class2::T%}; | |
| get nonNullableFunctionGetter() → core::Function | |
| return this.{self::Class2::nonNullableFunctionTypedField}{() → void}; | |
| get nullableFunctionGetter() → core::Function? | |
| return this.{self::Class2::nonNullableFunctionTypedField}{() → void}; | |
| get nonNullableFunctionTypedGetter() → () → void | |
| return this.{self::Class2::nonNullableFunctionTypedField}{() → void}; | |
| get nullableFunctionTypedGetter() → () →? void | |
| return this.{self::Class2::nonNullableFunctionTypedField}{() → void}; | |
| } | |
| static const field core::int i = #C1; | |
| static const field core::int j = #C2; | |
| static const field core::int k = #C3; | |
| static method test<T1 extends core::Function, T2 extends (core::int) → core::int, T3 extends core::Object? = dynamic>(self::Class1 nonNullableClass1, self::Class1? nullableClass1, dynamic dyn, Never never, self::Class2<core::String> nonNullableClass2, self::Class2<core::String>? nullableClass2, core::Function nonNullableFunction, core::Function? nullableFunction, (core::int) → core::int nonNullableFunctionType, (core::int) →? core::int nullableFunctionType, <T extends core::Object? = dynamic>(T%) → T% genericFunctionType, self::test::T1 nonNullableTypeVariable1, self::test::T1? nullableTypeVariable1, self::test::T2 nonNullableTypeVariable2, self::test::T2? nullableTypeVariable2, self::test::T3% undeterminedTypeVariable) → dynamic { | |
| core::print("InstanceInvocation"); | |
| nonNullableClass1.{self::Class1::method}(0){(core::int) → core::double}; | |
| let final self::Class1? #t1 = nullableClass1 in #t1 == null ?{core::double?} null : #t1{self::Class1}.{self::Class1::method}(0){(core::int) → core::double}; | |
| core::print("InstanceGet calls"); | |
| nonNullableClass2.{self::Class2::nonNullableFunctionField}{core::Function}(); | |
| nonNullableClass2.{self::Class2::nonNullableFunctionGetter}{core::Function}(); | |
| nonNullableClass2.{self::Class2::nonNullableFunctionTypedField}{() → void}(){() → void}; | |
| nonNullableClass2.{self::Class2::nonNullableFunctionTypedGetter}{() → void}(){() → void}; | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:72:42: Error: Can't use an expression of type 'Function?' as a function because it's potentially null. | |
| - 'Function' is from 'dart:core'. | |
| Try calling using ?.call instead. | |
| nonNullableClass2.nullableFunctionField(); | |
| ^" in nonNullableClass2.{self::Class2::nullableFunctionField}{core::Function?}{<nullable>}.(); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:73:43: Error: Can't use an expression of type 'Function?' as a function because it's potentially null. | |
| - 'Function' is from 'dart:core'. | |
| Try calling using ?.call instead. | |
| nonNullableClass2.nullableFunctionGetter(); | |
| ^" in nonNullableClass2.{self::Class2::nullableFunctionGetter}{core::Function?}{<nullable>}.(); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:74:47: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null. | |
| Try calling using ?.call instead. | |
| nonNullableClass2.nullableFunctionTypedField(); | |
| ^" in nonNullableClass2.{self::Class2::nullableFunctionTypedField}{() →? void}{<nullable>}.(){() →? void}; | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:75:48: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null. | |
| Try calling using ?.call instead. | |
| nonNullableClass2.nullableFunctionTypedGetter(); | |
| ^" in nonNullableClass2.{self::Class2::nullableFunctionTypedGetter}{() →? void}{<nullable>}.(){() →? void}; | |
| let final self::Class2<core::String> #t2 = nonNullableClass2 in let final core::int #t3 = 0 in #t2.{self::Class2::nonNullableFunctionField}{core::Function}(#t3); | |
| let final self::Class2<core::String> #t4 = nonNullableClass2 in let final core::int #t5 = 0 in #t4.{self::Class2::nonNullableFunctionGetter}{core::Function}(#t5); | |
| let final self::Class2<core::String> #t6 = nonNullableClass2 in let final core::int #t7 = 0 in invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:78:50: Error: Too many positional arguments: 0 allowed, but 1 found. | |
| Try removing the extra positional arguments. | |
| nonNullableClass2.nonNullableFunctionTypedField(0); | |
| ^" in #t6.{self::Class2::nonNullableFunctionTypedField}{() → void}{<inapplicable>}.(#t7); | |
| let final self::Class2<core::String> #t8 = nonNullableClass2 in let final core::int #t9 = 0 in invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:79:51: Error: Too many positional arguments: 0 allowed, but 1 found. | |
| Try removing the extra positional arguments. | |
| nonNullableClass2.nonNullableFunctionTypedGetter(0); | |
| ^" in #t8.{self::Class2::nonNullableFunctionTypedGetter}{() → void}{<inapplicable>}.(#t9); | |
| core::print("InstanceInvocation (Nullable)"); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:82:18: Error: Method 'method' cannot be called on 'Class1?' because it is potentially null. | |
| - 'Class1' is from 'pkg/front_end/testcases/none/method_invocation.dart'. | |
| Try calling using ?. instead. | |
| nullableClass1.method(0); | |
| ^^^^^^" in nullableClass1.{self::Class1::method}{<nullable>}.(0){(core::int) → core::double}; | |
| core::print("DynamicInvocation"); | |
| dyn{dynamic}.method(0); | |
| let final dynamic #t10 = dyn in #t10 == null ?{dynamic} null : #t10{dynamic}.method(0); | |
| dyn{dynamic}.toString(0); | |
| const core::int call_dyn = invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:88:28: Error: Method invocation is not a constant expression. | |
| const int call_dyn = dyn.toString(0); | |
| ^^^^^^^^"; | |
| core::print(invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:88:28: Error: Method invocation is not a constant expression. | |
| const int call_dyn = dyn.toString(0); | |
| ^^^^^^^^"); | |
| core::print("InstanceInvocation (Object)"); | |
| dyn.{core::Object::toString}{<object>}.(){() → core::String}; | |
| nullableClass1.{core::Object::toString}{<object>}.(){() → core::String}; | |
| nullableClass2.{core::Object::toString}{<object>}.(){() → core::String}; | |
| nullableFunction.{core::Object::toString}{<object>}.(){() → core::String}; | |
| nullableFunctionType.{core::Object::toString}{<object>}.(){() → core::String}; | |
| nullableTypeVariable1.{core::Object::toString}{<object>}.(){() → core::String}; | |
| nullableTypeVariable2.{core::Object::toString}{<object>}.(){() → core::String}; | |
| undeterminedTypeVariable.{core::Object::toString}{<object>}.(){() → core::String}; | |
| core::print("DynamicInvocation (Never)"); | |
| never{Never}.method(0); | |
| never{Never}.toString(); | |
| core::print("DynamicInvocation (Unresolved)"); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:106:21: Error: The method 'unresolved' isn't defined for the type 'Class1'. | |
| - 'Class1' is from 'pkg/front_end/testcases/none/method_invocation.dart'. | |
| Try correcting the name to the name of an existing method, or defining a method named 'unresolved'. | |
| nonNullableClass1.unresolved(); | |
| ^^^^^^^^^^" in nonNullableClass1{<unresolved>}.unresolved(); | |
| core::print("DynamicInvocation (Inapplicable)"); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:109:27: Error: Too few positional arguments: 1 required, 0 given. | |
| nonNullableClass1.method(); | |
| ^" in nonNullableClass1.{self::Class1::method}{<inapplicable>}.(){() → invalid-type}; | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:110:26: Error: Too few positional arguments: 1 required, 0 given. | |
| nonNullableFunctionType(); | |
| ^" in nonNullableFunctionType{<inapplicable>}.(); | |
| core::print("InstanceInvocation (generic)"); | |
| nonNullableClass2.{self::Class2::method}(0){(core::int) → core::String}; | |
| let final self::Class2<core::String>? #t11 = nullableClass2 in #t11 == null ?{core::String?} null : #t11{self::Class2<core::String>}.{self::Class2::method}(0){(core::int) → core::String}; | |
| nonNullableClass2.{self::Class2::call}(){() → core::String}; | |
| nonNullableClass2.{self::Class2::call}(){() → core::String}; | |
| core::print("FunctionInvocation"); | |
| nonNullableFunction(0); | |
| nonNullableFunction(0); | |
| let final core::Function? #t12 = nullableFunction in #t12 == null ?{dynamic} null : #t12{core::Function}(0); | |
| nonNullableFunctionType(0){(core::int) → core::int}; | |
| nonNullableFunctionType(0){(core::int) → core::int}; | |
| let final (core::int) →? core::int #t13 = nullableFunctionType in #t13 == null ?{core::int?} null : #t13{(core::int) → core::int}(0){(core::int) → core::int}; | |
| genericFunctionType<core::int>(0){(core::int) → core::int}; | |
| genericFunctionType<core::num>(0){(core::num) → core::num}; | |
| core::num i = genericFunctionType<core::num>(0){(core::num) → core::num}; | |
| nonNullableTypeVariable1(0); | |
| nonNullableTypeVariable1(0); | |
| let final self::test::T1? #t14 = nullableTypeVariable1 in #t14 == null ?{dynamic} null : #t14{self::test::T1}(0); | |
| nonNullableTypeVariable2(0){(core::int) → core::int}; | |
| nonNullableTypeVariable2(0){(core::int) → core::int}; | |
| let final self::test::T2? #t15 = nullableTypeVariable2 in #t15 == null ?{core::int?} null : #t15{self::test::T2}(0){(core::int) → core::int}; | |
| core::print("FunctionInvocation (Nullable)"); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:136:19: Error: Can't use an expression of type 'Function?' as a function because it's potentially null. | |
| - 'Function' is from 'dart:core'. | |
| Try calling using ?.call instead. | |
| nullableFunction(0); | |
| ^" in nullableFunction{<nullable>}.(0); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:137:20: Error: Method 'call' cannot be called on 'Function?' because it is potentially null. | |
| - 'Function' is from 'dart:core'. | |
| Try calling using ?. instead. | |
| nullableFunction.call(0); | |
| ^^^^" in nullableFunction{<nullable>}.(0); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:138:23: Error: Can't use an expression of type 'int Function(int)?' as a function because it's potentially null. | |
| Try calling using ?.call instead. | |
| nullableFunctionType(0); | |
| ^" in nullableFunctionType{<nullable>}.(0){(core::int) →? core::int}; | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:139:24: Error: Method 'call' cannot be called on 'int Function(int)?' because it is potentially null. | |
| Try calling using ?. instead. | |
| nullableFunctionType.call(0); | |
| ^^^^" in nullableFunctionType{<nullable>}.(0){(core::int) →? core::int}; | |
| core::print("DynamicInvocation (Invalid)"); | |
| invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:142:27: Error: Too few positional arguments: 1 required, 0 given. | |
| nonNullableClass1.method().method(0); | |
| ^" in nonNullableClass1.{self::Class1::method}{<inapplicable>}.(){() → invalid-type}{dynamic}.method(0); | |
| core::print("LocalFunctionInvocation"); | |
| function localFunction() → core::int | |
| return 42; | |
| function genericLocalFunction<T extends core::Object? = dynamic>(T% t) → T% | |
| return t; | |
| localFunction(){() → core::int}; | |
| genericLocalFunction<core::int>(0){(core::int) → core::int}; | |
| genericLocalFunction<core::num>(0){(core::num) → core::num}; | |
| const core::int call_localFunction = invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:151:34: Error: Not a constant expression. | |
| const int call_localFunction = localFunction(); | |
| ^^^^^^^^^^^^^"; | |
| core::print(invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:151:34: Error: Not a constant expression. | |
| const int call_localFunction = localFunction(); | |
| ^^^^^^^^^^^^^"); | |
| () → core::int f = () → core::int => 42; | |
| const core::int call_f = invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:156:22: Error: Not a constant expression. | |
| const int call_f = f(); | |
| ^"; | |
| core::print(invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:156:22: Error: Not a constant expression. | |
| const int call_f = f(); | |
| ^"); | |
| const core::int? nullable = #C4; | |
| const core::bool equals_null = #C5; | |
| core::print(#C5); | |
| const core::bool equals = invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:161:23: Error: Not a constant expression. | |
| const bool equals = i == j; | |
| ^"; | |
| core::print(invalid-expression "pkg/front_end/testcases/none/method_invocation.dart:161:23: Error: Not a constant expression. | |
| const bool equals = i == j; | |
| ^"); | |
| } | |
| static method main() → dynamic {} | |
| constants { | |
| #C1 = 4 | |
| #C2 = 24 | |
| #C3 = 96 | |
| #C4 = 0 | |
| #C5 = false | |
| } |