blob: f3731f0e68882653385a98abfb8d7efa31c73d4e [file] [log] [blame]
library;
//
// 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: Can't tear off method 'call' from a potentially null value.
// functionContext(t); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:19:27: Error: Can't tear off method 'call' from a potentially null value.
// nullableFunctionContext(t); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:20:19: Error: Can't tear off method 'call' from a potentially null value.
// functionContext(nt); // Error.
// ^
//
// pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:21:27: Error: Can't tear off method 'call' from a potentially null value.
// nullableFunctionContext(nt); // 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? c, self::foo::T% t, self::foo::T? nt) dynamic {
self::functionContext(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 self::C?) as{TypeError} () core::int);
self::nullableFunctionContext(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 self::C?) as{TypeError} () →? core::int);
self::functionContext(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(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(invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:18:19: Error: Can't tear off method 'call' from a potentially null value.
functionContext(t); // Error.
^" in t as{TypeError} () core::int);
self::nullableFunctionContext(invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:19:27: Error: Can't tear off method 'call' from a potentially null value.
nullableFunctionContext(t); // Error.
^" in t as{TypeError} () →? core::int);
self::functionContext(invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:20:19: Error: Can't tear off method 'call' from a potentially null value.
functionContext(nt); // Error.
^" in nt as{TypeError} () core::int);
self::nullableFunctionContext(invalid-expression "pkg/front_end/testcases/nnbd/tearoff_from_nullable_receiver.dart:21:27: Error: Can't tear off method 'call' from a potentially null value.
nullableFunctionContext(nt); // Error.
^" in nt as{TypeError} () →? core::int);
}
static method bar<T extends self::C>(self::C c, self::bar::T t) dynamic {
self::functionContext(let final self::C #t1 = c in #t1 == null ?{() → core::int} null : #t1.{self::C::call}{() → core::int});
self::nullableFunctionContext(let final self::C #t2 = c in #t2 == null ?{() → core::int} null : #t2.{self::C::call}{() → core::int});
self::functionContext(let final self::bar::T #t3 = t in #t3 == null ?{() → core::int} null : #t3.{self::C::call}{() → core::int});
self::nullableFunctionContext(let final self::bar::T #t4 = t in #t4 == null ?{() → core::int} null : #t4.{self::C::call}{() → core::int});
}
static method main() dynamic {}