blob: e93db551951eb0445c4a5dae55c539e90d3a3047 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/call.dart:12:4: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null.
// Try calling using ?.call instead.
// f();
// ^
//
// pkg/front_end/testcases/nnbd/call.dart:13:5: Error: Method 'call' cannot be called on 'void Function()?' because it is potentially null.
// Try calling using ?. instead.
// f.call();
// ^^^^
//
// pkg/front_end/testcases/nnbd/call.dart:15:10: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null.
// Try calling using ?.call instead.
// c.field();
// ^
//
// pkg/front_end/testcases/nnbd/call.dart:16:11: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null.
// Try calling using ?.call instead.
// c.getter();
// ^
//
import self as self;
import "dart:core" as core;
class Class extends core::Object {
field () →? void field = null;
synthetic constructor •() self::Class
: super core::Object::•()
;
get getter() () →? void
return null;
}
static method error() dynamic {
() →? void f;
invalid-expression "pkg/front_end/testcases/nnbd/call.dart:12:4: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null.
Try calling using ?.call instead.
f();
^" in f{<nullable>}.(){() →? void};
invalid-expression "pkg/front_end/testcases/nnbd/call.dart:13:5: Error: Method 'call' cannot be called on 'void Function()?' because it is potentially null.
Try calling using ?. instead.
f.call();
^^^^" in f{<nullable>}.(){() →? void};
self::Class c = new self::Class::•();
invalid-expression "pkg/front_end/testcases/nnbd/call.dart:15:10: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null.
Try calling using ?.call instead.
c.field();
^" in c.{self::Class::field}{() →? void}{<nullable>}.(){() →? void};
invalid-expression "pkg/front_end/testcases/nnbd/call.dart:16:11: Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null.
Try calling using ?.call instead.
c.getter();
^" in c.{self::Class::getter}{() →? void}{<nullable>}.(){() →? void};
}
static method main() dynamic {}