blob: b67ccfaac87efdd0da8d0f3cf0bddbf7105f075d [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/extensions/private_members.dart:23:14: Error: Method not found: '_PrivateExtension'.
// expect(42, _PrivateExtension("").publicMethod1());
// ^^^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:24:14: Error: Method not found: '_PrivateExtension'.
// expect(87, _PrivateExtension("")._privateMethod1());
// ^^^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:25:35: Error: Method not found: '_privateMethod2'.
// expect(237, PublicExtension("")._privateMethod2());
// ^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:27:14: Error: Undefined name '_PrivateExtension'.
// expect(24, _PrivateExtension.publicStaticMethod1());
// ^^^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:28:14: Error: Undefined name '_PrivateExtension'.
// expect(78, _PrivateExtension._privateStaticMethod1());
// ^^^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:29:31: Error: Member not found: 'PublicExtension._privateStaticMethod2'.
// expect(732, PublicExtension._privateStaticMethod2());
// ^^^^^^^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:17:17: Error: The method 'publicMethod1' isn't defined for the class 'String'.
// Try correcting the name to the name of an existing method, or defining a method named 'publicMethod1'.
// expect(42, "".publicMethod1());
// ^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:18:17: Error: The method '_privateMethod1' isn't defined for the class 'String'.
// Try correcting the name to the name of an existing method, or defining a method named '_privateMethod1'.
// expect(87, ""._privateMethod1());
// ^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:19:18: Error: The method '_privateMethod2' isn't defined for the class 'String'.
// Try correcting the name to the name of an existing method, or defining a method named '_privateMethod2'.
// expect(237, ""._privateMethod2());
// ^^^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:20:18: Error: The method 'publicMethod3' isn't defined for the class 'String'.
// Try correcting the name to the name of an existing method, or defining a method named 'publicMethod3'.
// expect(473, "".publicMethod3());
// ^^^^^^^^^^^^^
//
// pkg/front_end/testcases/extensions/private_members.dart:21:18: Error: The method '_privateMethod3' isn't defined for the class 'String'.
// Try correcting the name to the name of an existing method, or defining a method named '_privateMethod3'.
// expect(586, ""._privateMethod3());
// ^^^^^^^^^^^^^^^
//
import self as self;
import "private_members_lib.dart" as pri;
import "org-dartlang-testcase:///private_members_lib.dart";
static method main() dynamic {
pri::test();
pri::expect(123, pri::PublicExtension|publicMethod2(""));
pri::expect(123, pri::PublicExtension|publicMethod2(""));
pri::expect(321, pri::PublicExtension|publicStaticMethod2());
}
static method errors() dynamic {
pri::expect(42, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:17:17: Error: The method 'publicMethod1' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'publicMethod1'.
expect(42, \"\".publicMethod1());
^^^^^^^^^^^^^" in ""{<unresolved>}.publicMethod1());
pri::expect(87, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:18:17: Error: The method '_privateMethod1' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named '_privateMethod1'.
expect(87, \"\"._privateMethod1());
^^^^^^^^^^^^^^^" in ""{<unresolved>}._privateMethod1());
pri::expect(237, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:19:18: Error: The method '_privateMethod2' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named '_privateMethod2'.
expect(237, \"\"._privateMethod2());
^^^^^^^^^^^^^^^" in ""{<unresolved>}._privateMethod2());
pri::expect(473, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:20:18: Error: The method 'publicMethod3' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named 'publicMethod3'.
expect(473, \"\".publicMethod3());
^^^^^^^^^^^^^" in ""{<unresolved>}.publicMethod3());
pri::expect(586, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:21:18: Error: The method '_privateMethod3' isn't defined for the class 'String'.
Try correcting the name to the name of an existing method, or defining a method named '_privateMethod3'.
expect(586, \"\"._privateMethod3());
^^^^^^^^^^^^^^^" in ""{<unresolved>}._privateMethod3());
pri::expect(42, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:23:14: Error: Method not found: '_PrivateExtension'.
expect(42, _PrivateExtension(\"\").publicMethod1());
^^^^^^^^^^^^^^^^^"{dynamic}.publicMethod1());
pri::expect(87, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:24:14: Error: Method not found: '_PrivateExtension'.
expect(87, _PrivateExtension(\"\")._privateMethod1());
^^^^^^^^^^^^^^^^^"{dynamic}._privateMethod1());
pri::expect(237, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:25:35: Error: Method not found: '_privateMethod2'.
expect(237, PublicExtension(\"\")._privateMethod2());
^^^^^^^^^^^^^^^");
pri::expect(24, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:27:14: Error: Undefined name '_PrivateExtension'.
expect(24, _PrivateExtension.publicStaticMethod1());
^^^^^^^^^^^^^^^^^"{dynamic}.publicStaticMethod1());
pri::expect(78, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:28:14: Error: Undefined name '_PrivateExtension'.
expect(78, _PrivateExtension._privateStaticMethod1());
^^^^^^^^^^^^^^^^^"{dynamic}._privateStaticMethod1());
pri::expect(732, invalid-expression "pkg/front_end/testcases/extensions/private_members.dart:29:31: Error: Member not found: 'PublicExtension._privateStaticMethod2'.
expect(732, PublicExtension._privateStaticMethod2());
^^^^^^^^^^^^^^^^^^^^^");
}
library /*isNonNullableByDefault*/;
import self as pri;
import "dart:core" as core;
extension _PrivateExtension on core::String {
method publicMethod1 = pri::_PrivateExtension|publicMethod1;
tearoff publicMethod1 = pri::_PrivateExtension|get#publicMethod1;
method _privateMethod1 = pri::_PrivateExtension|_privateMethod1;
tearoff _privateMethod1 = pri::_PrivateExtension|get#_privateMethod1;
static method publicStaticMethod1 = pri::_PrivateExtension|publicStaticMethod1;
static method _privateStaticMethod1 = pri::_PrivateExtension|_privateStaticMethod1;
method test1 = pri::_PrivateExtension|test1;
tearoff test1 = pri::_PrivateExtension|get#test1;
}
extension PublicExtension on core::String {
method publicMethod2 = pri::PublicExtension|publicMethod2;
tearoff publicMethod2 = pri::PublicExtension|get#publicMethod2;
method _privateMethod2 = pri::PublicExtension|_privateMethod2;
tearoff _privateMethod2 = pri::PublicExtension|get#_privateMethod2;
static method publicStaticMethod2 = pri::PublicExtension|publicStaticMethod2;
static method _privateStaticMethod2 = pri::PublicExtension|_privateStaticMethod2;
method test2 = pri::PublicExtension|test2;
tearoff test2 = pri::PublicExtension|get#test2;
}
extension _extension#0 on core::String {
method publicMethod3 = pri::_extension#0|publicMethod3;
tearoff publicMethod3 = pri::_extension#0|get#publicMethod3;
method _privateMethod3 = pri::_extension#0|_privateMethod3;
tearoff _privateMethod3 = pri::_extension#0|get#_privateMethod3;
static method publicStaticMethod3 = pri::_extension#0|publicStaticMethod3;
static method _privateStaticMethod3 = pri::_extension#0|_privateStaticMethod3;
method test3 = pri::_extension#0|test3;
tearoff test3 = pri::_extension#0|get#test3;
}
static method _PrivateExtension|publicMethod1(lowered final core::String #this) → core::int
return 42;
static method _PrivateExtension|get#publicMethod1(lowered final core::String #this) → () → core::int
return () core::int => pri::_PrivateExtension|publicMethod1(#this);
static method _PrivateExtension|_privateMethod1(lowered final core::String #this) → core::int
return 87;
static method _PrivateExtension|get#_privateMethod1(lowered final core::String #this) → () → core::int
return () core::int => pri::_PrivateExtension|_privateMethod1(#this);
static method _PrivateExtension|publicStaticMethod1() core::int
return 24;
static method _PrivateExtension|_privateStaticMethod1() core::int
return 78;
static method _PrivateExtension|test1(lowered final core::String #this) → dynamic {
pri::expect(42, pri::_PrivateExtension|publicMethod1(#this));
pri::expect(87, pri::_PrivateExtension|_privateMethod1(#this));
pri::expect(24, pri::_PrivateExtension|publicStaticMethod1());
pri::expect(78, pri::_PrivateExtension|_privateStaticMethod1());
}
static method _PrivateExtension|get#test1(lowered final core::String #this) → () → dynamic
return () dynamic => pri::_PrivateExtension|test1(#this);
static method PublicExtension|publicMethod2(lowered final core::String #this) → core::int
return 123;
static method PublicExtension|get#publicMethod2(lowered final core::String #this) → () → core::int
return () core::int => pri::PublicExtension|publicMethod2(#this);
static method PublicExtension|_privateMethod2(lowered final core::String #this) → core::int
return 237;
static method PublicExtension|get#_privateMethod2(lowered final core::String #this) → () → core::int
return () core::int => pri::PublicExtension|_privateMethod2(#this);
static method PublicExtension|publicStaticMethod2() core::int
return 321;
static method PublicExtension|_privateStaticMethod2() core::int
return 732;
static method PublicExtension|test2(lowered final core::String #this) → dynamic {
pri::expect(123, pri::PublicExtension|publicMethod2(#this));
pri::expect(237, pri::PublicExtension|_privateMethod2(#this));
pri::expect(321, pri::PublicExtension|publicStaticMethod2());
pri::expect(732, pri::PublicExtension|_privateStaticMethod2());
}
static method PublicExtension|get#test2(lowered final core::String #this) → () → dynamic
return () dynamic => pri::PublicExtension|test2(#this);
static method _extension#0|publicMethod3(lowered final core::String #this) → core::int
return 473;
static method _extension#0|get#publicMethod3(lowered final core::String #this) → () → core::int
return () core::int => pri::_extension#0|publicMethod3(#this);
static method _extension#0|_privateMethod3(lowered final core::String #this) → core::int
return 586;
static method _extension#0|get#_privateMethod3(lowered final core::String #this) → () → core::int
return () core::int => pri::_extension#0|_privateMethod3(#this);
static method _extension#0|publicStaticMethod3() → core::int
return 374;
static method _extension#0|_privateStaticMethod3() → core::int
return 685;
static method _extension#0|test3(lowered final core::String #this) → dynamic {
pri::expect(473, pri::_extension#0|publicMethod3(#this));
pri::expect(586, pri::_extension#0|_privateMethod3(#this));
pri::expect(374, pri::_extension#0|publicStaticMethod3());
pri::expect(685, pri::_extension#0|_privateStaticMethod3());
}
static method _extension#0|get#test3(lowered final core::String #this) → () → dynamic
return () dynamic => pri::_extension#0|test3(#this);
static method test() dynamic {
pri::expect(42, pri::_PrivateExtension|publicMethod1(""));
pri::expect(87, pri::_PrivateExtension|_privateMethod1(""));
pri::expect(123, pri::PublicExtension|publicMethod2(""));
pri::expect(237, pri::PublicExtension|_privateMethod2(""));
pri::expect(473, pri::_extension#0|publicMethod3(""));
pri::expect(586, pri::_extension#0|_privateMethod3(""));
pri::expect(42, pri::_PrivateExtension|publicMethod1(""));
pri::expect(87, pri::_PrivateExtension|_privateMethod1(""));
pri::expect(123, pri::PublicExtension|publicMethod2(""));
pri::expect(237, pri::PublicExtension|_privateMethod2(""));
pri::expect(24, pri::_PrivateExtension|publicStaticMethod1());
pri::expect(78, pri::_PrivateExtension|_privateStaticMethod1());
pri::expect(321, pri::PublicExtension|publicStaticMethod2());
pri::expect(732, pri::PublicExtension|_privateStaticMethod2());
pri::_PrivateExtension|test1("");
pri::PublicExtension|test2("");
pri::_extension#0|test3("");
}
static method expect(dynamic expected, dynamic actual) dynamic {
if(!(expected =={core::Object::==}{(core::Object) core::bool} actual)) {
throw "Mismatch: expected=${expected}, actual=${actual}";
}
}