blob: 19bd0ebd1469c629da7fcf76eb4da178bb945c4d [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:14:24: Error: Can't tear off method 'call' from a potentially null value.
// functionContext(null as C?); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:15:32: Error: Can't tear off method 'call' from a potentially null value.
// nullableFunctionContext(null as C?); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:16:19: Error: Can't tear off method 'call' from a potentially null value.
// functionContext(c); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:17:27: Error: Can't tear off method 'call' from a potentially null value.
// nullableFunctionContext(c); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:18:19: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()'.
// functionContext(t); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:19:27: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()?'.
// nullableFunctionContext(t); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:20:19: Error: The argument type 'T?' can't be assigned to the parameter type 'int Function()'.
// functionContext(nt); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:21:27: Error: The argument type 'T?' can't be assigned to the parameter type 'int Function()?'.
// nullableFunctionContext(nt); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:27:19: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()'.
// functionContext(t); // Shouldn't result in a compile-time error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:28:27: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()?'.
// nullableFunctionContext(t); // Shouldn't result in a compile-time error.
// ^
//
import self as self;
import "dart:core" as core;
class C extends core::Object {
synthetic constructor •() self::C
: super core::Object::•()
;
method call() core::int
return 0;
}
static method functionContext(() core::int f) dynamic {}
static method nullableFunctionContext(() →? core::int f) dynamic {}
static method foo<T extends self::C? = self::C?>(self::C? c, self::foo::T% t, self::foo::T? nt) dynamic {
self::functionContext(let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:14:24: Error: Can't tear off method 'call' from a potentially null value.
functionContext(null as C?); // Error.
^" in (null as{ForNonNullableByDefault} self::C?) as{TypeError} () → core::int);
self::nullableFunctionContext(let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:15:32: Error: Can't tear off method 'call' from a potentially null value.
nullableFunctionContext(null as C?); // Error.
^" in (null as{ForNonNullableByDefault} self::C?) as{TypeError} () →? core::int);
self::functionContext(let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:16:19: Error: Can't tear off method 'call' from a potentially null value.
functionContext(c); // Error.
^" in c as{TypeError} () → core::int);
self::nullableFunctionContext(let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:17:27: Error: Can't tear off method 'call' from a potentially null value.
nullableFunctionContext(c); // Error.
^" in c as{TypeError} () →? core::int);
self::functionContext(let final<BottomType> #t5 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:18:19: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()'.
functionContext(t); // Error.
^" in t as{TypeError,ForNonNullableByDefault} () → core::int);
self::nullableFunctionContext(let final<BottomType> #t6 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:19:27: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()?'.
nullableFunctionContext(t); // Error.
^" in t as{TypeError,ForNonNullableByDefault} () →? core::int);
self::functionContext(let final<BottomType> #t7 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:20:19: Error: The argument type 'T?' can't be assigned to the parameter type 'int Function()'.
functionContext(nt); // Error.
^" in nt as{TypeError,ForNonNullableByDefault} () → core::int);
self::nullableFunctionContext(let final<BottomType> #t8 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:21:27: Error: The argument type 'T?' can't be assigned to the parameter type 'int Function()?'.
nullableFunctionContext(nt); // Error.
^" in nt as{TypeError,ForNonNullableByDefault} () →? core::int);
}
static method bar<T extends self::C = self::C>(self::C c, self::bar::T t) → dynamic {
self::functionContext(let final self::C #t9 = c in #t9.==(null) ?{() → core::int} null : #t9.{self::C::call});
self::nullableFunctionContext(let final self::C #t10 = c in #t10.==(null) ?{() → core::int} null : #t10.{self::C::call});
self::functionContext(let final<BottomType> #t11 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:27:19: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()'.
functionContext(t); // Shouldn't result in a compile-time error.
^" in t as{TypeError,ForNonNullableByDefault} () → core::int);
self::nullableFunctionContext(let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:28:27: Error: The argument type 'T' can't be assigned to the parameter type 'int Function()?'.
nullableFunctionContext(t); // Shouldn't result in a compile-time error.
^" in t as{TypeError,ForNonNullableByDefault} () →? core::int);
}
static method main() → dynamic {}