blob: 23f6081977d7dd008af5802b4e68c58e37aafa71 [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/nullable_param.dart:5:6: Error: This requires the 'non-nullable' experiment to be enabled.
// Try enabling this experiment by adding it to the command line when compiling and running.
// int? field;
// ^
//
// pkg/front_end/testcases/nnbd/nullable_param.dart:6:6: Error: This requires the 'non-nullable' experiment to be enabled.
// Try enabling this experiment by adding it to the command line when compiling and running.
// int? bar(int? x);
// ^
//
// pkg/front_end/testcases/nnbd/nullable_param.dart:6:15: Error: This requires the 'non-nullable' experiment to be enabled.
// Try enabling this experiment by adding it to the command line when compiling and running.
// int? bar(int? x);
// ^
//
// pkg/front_end/testcases/nnbd/nullable_param.dart:17:54: Error: This requires the 'non-nullable' experiment to be enabled.
// Try enabling this experiment by adding it to the command line when compiling and running.
// int test_nullable_function_type_formal_param({int f()? : null}) {
// ^
//
// pkg/front_end/testcases/nnbd/nullable_param.dart:4:7: Error: The non-abstract class 'Foo' is missing implementations for these members:
// - Foo.bar
// Try to either
// - provide an implementation,
// - inherit an implementation from a superclass or mixin,
// - mark the class as abstract, or
// - provide a 'noSuchMethod' implementation.
//
// class Foo {
// ^^^
// pkg/front_end/testcases/nnbd/nullable_param.dart:6:8: Context: 'Foo.bar' is defined here.
// int? bar(int? x);
// ^^^
//
import self as self;
import "dart:core" as core;
class Foo extends core::Object {
field core::int* field = null;
synthetic constructor •() self::Foo*
: super core::Object::•()
;
abstract method bar(core::int* x) core::int*;
}
static method main() dynamic {
self::Foo* foo = new self::Foo::•();
foo.field = 5;
foo.bar(6);
self::test_nullable_function_type_formal_param(f: () dynamic => 2);
}
static method test_nullable_function_type_formal_param({() →* core::int* f = #C1}) → core::int* {
return let final dynamic #t1 = f.call() in #t1.==(null) ? 1.unary-() : #t1;
}
constants {
#C1 = null
}