blob: 4627c5912460a0bbc2a948537ee1ad65e13bbc95 [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/extensions/issue40713.dart:22:8: Error: 'safeFirst' isn't a function or method and can't be invoked.
// list.safeFirst();
// ^^^^^^^^^
//
// pkg/front_end/testcases/extensions/issue40713.dart:24:18: Error: Too few positional arguments: 1 required, 0 given.
// list2.safeFirst();
// ^
//
import self as self;
import "dart:core" as core;
extension SafeAccess<T extends core::Object* = dynamic> on core::Iterable<T*>* {
get safeFirst = self::SafeAccess|get#safeFirst;
}
static method SafeAccess|get#safeFirst<T extends core::Object* = dynamic>(lowered final core::Iterable<self::SafeAccess|get#safeFirst::T*>* #this) → self::SafeAccess|get#safeFirst::T* {
return #this.{core::Iterable::isNotEmpty}{core::bool*} ?{self::SafeAccess|get#safeFirst::T*} #this.{core::Iterable::first}{self::SafeAccess|get#safeFirst::T*} : null;
}
static method main() dynamic {}
static method test() void {
final core::List<dynamic>* list = core::_GrowableList::•<dynamic>(0);
self::SafeAccess|get#safeFirst<dynamic>(list){dynamic}.call();
final core::List<(core::int*) →* void>* list2 = core::_GrowableList::•<(core::int*) →* void>(0);
self::SafeAccess|get#safeFirst<(core::int*) →* void>(list2)(0){(core::int*) →* void};
}
static method errors() void {
final core::List<core::Object*>* list = core::_GrowableList::•<core::Object*>(0);
invalid-expression "pkg/front_end/testcases/extensions/issue40713.dart:22:8: Error: 'safeFirst' isn't a function or method and can't be invoked.
list.safeFirst();
^^^^^^^^^";
final core::List<(core::int*) →* void>* list2 = core::_GrowableList::•<(core::int*) →* void>(0);
let final Never* #t1 = invalid-expression "pkg/front_end/testcases/extensions/issue40713.dart:24:18: Error: Too few positional arguments: 1 required, 0 given.
list2.safeFirst();
^" in self::SafeAccess|get#safeFirst<(core::int*) →* void>(list2){<inapplicable>}.();
}