25513e6f07
+ evaluate inline class annotations Change-Id: Ia5a17b4ecf2fc273e347374c9ad7713301103c96 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280101 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
161 lines
10 KiB
Plaintext
161 lines
10 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/inline_class/method_access.dart:31:10: Error: The getter 'setter' isn't defined for the class 'InlineClass'.
|
|
// Try correcting the name to the name of an existing getter, or defining a getter or field named 'setter'.
|
|
// this.setter; // Error, should not resolve to extension method.
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/method_access.dart:32:5: Error: The getter 'setter' isn't defined for the class 'InlineClass'.
|
|
// Try correcting the name to the name of an existing getter, or defining a getter or field named 'setter'.
|
|
// setter; // Error, should not resolve to extension method.
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/method_access.dart:33:10: Error: The setter 'getter' isn't defined for the class 'InlineClass'.
|
|
// Try correcting the name to the name of an existing setter, or defining a setter or field named 'getter'.
|
|
// this.getter = 42; // Error, should not resolve to extension method.
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/method_access.dart:34:5: Error: The setter 'getter' isn't defined for the class 'InlineClass'.
|
|
// Try correcting the name to the name of an existing setter, or defining a setter or field named 'getter'.
|
|
// getter = 42; // Error, should not resolve to extension method.
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/method_access.dart:77:6: Error: The getter 'setter' isn't defined for the class 'InlineClass'.
|
|
// Try correcting the name to the name of an existing getter, or defining a getter or field named 'setter'.
|
|
// ic.setter; // Error, should not resolve to extension method.
|
|
// ^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/inline_class/method_access.dart:78:6: Error: The setter 'getter' isn't defined for the class 'InlineClass'.
|
|
// Try correcting the name to the name of an existing setter, or defining a setter or field named 'getter'.
|
|
// ic.getter = 42; // Error, should not resolve to extension method.
|
|
// ^^^^^^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
extension /* unnamed */ _extension#0 on core::Object {
|
|
get setter = self::_extension#0|get#setter;
|
|
set getter = self::_extension#0|set#getter;
|
|
}
|
|
inline class InlineClass /* declaredRepresentationType = core::int */ {
|
|
method test = self::InlineClass|test;
|
|
tearoff test = self::InlineClass|get#test;
|
|
operator + = self::InlineClass|+;
|
|
operator unary- = self::InlineClass|unary-;
|
|
operator [] = self::InlineClass|[];
|
|
operator []= = self::InlineClass|[]=;
|
|
get getter = self::InlineClass|get#getter;
|
|
method method = self::InlineClass|method;
|
|
tearoff method = self::InlineClass|get#method;
|
|
method genericMethod = self::InlineClass|genericMethod;
|
|
tearoff genericMethod = self::InlineClass|get#genericMethod;
|
|
method call = self::InlineClass|call;
|
|
tearoff call = self::InlineClass|get#call;
|
|
set setter = self::InlineClass|set#setter;
|
|
constructor • = self::InlineClass|;
|
|
tearoff • = self::InlineClass|get#;
|
|
}
|
|
static method _extension#0|get#setter(lowered final core::Object #this) → core::int
|
|
return 42;
|
|
static method _extension#0|set#getter(lowered final core::Object #this, core::int value) → void {}
|
|
static method InlineClass|(core::int it) → self::InlineClass {
|
|
final self::InlineClass #this = it;
|
|
return #this;
|
|
}
|
|
static method InlineClass|get#(core::int it) → self::InlineClass
|
|
return self::InlineClass|(it);
|
|
static method InlineClass|test(lowered final self::InlineClass #this) → dynamic {
|
|
core::int a = self::InlineClass|+(#this, 2);
|
|
core::int b = self::InlineClass|unary-(#this);
|
|
core::int c = self::InlineClass|[](#this, 2);
|
|
core::int d = let final core::int #t1 = 3 in let final core::int #t2 = 42 in let final void #t3 = self::InlineClass|[]=(#this, #t1, #t2) in #t2;
|
|
core::int e1 = self::InlineClass|get#getter(#this);
|
|
core::int e2 = self::InlineClass|get#getter(#this);
|
|
() → core::int f1 = self::InlineClass|get#method(#this);
|
|
() → core::int f2 = self::InlineClass|get#method(#this);
|
|
core::int g1 = let final core::int #t4 = 42 in let final void #t5 = self::InlineClass|set#setter(#this, #t4) in #t4;
|
|
core::int g2 = let final core::int #t6 = 42 in let final void #t7 = self::InlineClass|set#setter(#this, #t6) in #t6;
|
|
self::InlineClass|set#setter(#this, 87);
|
|
self::InlineClass|set#setter(#this, 87);
|
|
(core::int) → core::int h1 = self::InlineClass|get#genericMethod(#this)<core::int>;
|
|
(core::int) → core::int h2 = self::InlineClass|get#genericMethod(#this)<core::int>;
|
|
invalid-expression "pkg/front_end/testcases/inline_class/method_access.dart:31:10: Error: The getter 'setter' isn't defined for the class 'InlineClass'.
|
|
Try correcting the name to the name of an existing getter, or defining a getter or field named 'setter'.
|
|
this.setter; // Error, should not resolve to extension method.
|
|
^^^^^^" in #this{<unresolved>}.setter;
|
|
invalid-expression "pkg/front_end/testcases/inline_class/method_access.dart:32:5: Error: The getter 'setter' isn't defined for the class 'InlineClass'.
|
|
Try correcting the name to the name of an existing getter, or defining a getter or field named 'setter'.
|
|
setter; // Error, should not resolve to extension method.
|
|
^^^^^^" in #this{<unresolved>}.setter;
|
|
invalid-expression "pkg/front_end/testcases/inline_class/method_access.dart:33:10: Error: The setter 'getter' isn't defined for the class 'InlineClass'.
|
|
Try correcting the name to the name of an existing setter, or defining a setter or field named 'getter'.
|
|
this.getter = 42; // Error, should not resolve to extension method.
|
|
^^^^^^" in #this{<unresolved>}.getter = 42;
|
|
invalid-expression "pkg/front_end/testcases/inline_class/method_access.dart:34:5: Error: The setter 'getter' isn't defined for the class 'InlineClass'.
|
|
Try correcting the name to the name of an existing setter, or defining a setter or field named 'getter'.
|
|
getter = 42; // Error, should not resolve to extension method.
|
|
^^^^^^" in #this{<unresolved>}.getter = 42;
|
|
core::int i1 = self::InlineClass|method(#this);
|
|
core::int i2 = self::InlineClass|method(#this);
|
|
core::num j1 = self::InlineClass|genericMethod<core::num>(#this, 0);
|
|
core::num j2 = self::InlineClass|genericMethod<core::num>(#this, 0);
|
|
core::int k1 = self::InlineClass|genericMethod<core::int>(#this, 0);
|
|
core::int k2 = self::InlineClass|genericMethod<core::int>(#this, 0);
|
|
core::num l1 = self::InlineClass|genericMethod<core::num>(#this, 0);
|
|
core::num l2 = self::InlineClass|genericMethod<core::num>(#this, 0);
|
|
core::int m = self::InlineClass|call(#this);
|
|
core::int n1 = self::InlineClass|call(#this);
|
|
core::int n2 = self::InlineClass|call(#this);
|
|
}
|
|
static method InlineClass|get#test(lowered final self::InlineClass #this) → () → dynamic
|
|
return () → dynamic => self::InlineClass|test(#this);
|
|
static method InlineClass|+(lowered final self::InlineClass #this, core::int other) → core::int
|
|
return 42;
|
|
static method InlineClass|unary-(lowered final self::InlineClass #this) → core::int
|
|
return 87;
|
|
static method InlineClass|[](lowered final self::InlineClass #this, core::int index) → core::int
|
|
return 123;
|
|
static method InlineClass|[]=(lowered final self::InlineClass #this, core::int index, core::int value) → void {}
|
|
static method InlineClass|get#getter(lowered final self::InlineClass #this) → core::int
|
|
return 42;
|
|
static method InlineClass|method(lowered final self::InlineClass #this) → core::int
|
|
return 42;
|
|
static method InlineClass|get#method(lowered final self::InlineClass #this) → () → core::int
|
|
return () → core::int => self::InlineClass|method(#this);
|
|
static method InlineClass|set#setter(lowered final self::InlineClass #this, core::int value) → void {}
|
|
static method InlineClass|genericMethod<T extends core::Object? = dynamic>(lowered final self::InlineClass #this, self::InlineClass|genericMethod::T% t) → self::InlineClass|genericMethod::T%
|
|
return t;
|
|
static method InlineClass|get#genericMethod(lowered final self::InlineClass #this) → <T extends core::Object? = dynamic>(T%) → T%
|
|
return <T extends core::Object? = dynamic>(T% t) → T% => self::InlineClass|genericMethod<T%>(#this, t);
|
|
static method InlineClass|call(lowered final self::InlineClass #this) → core::int
|
|
return 321;
|
|
static method InlineClass|get#call(lowered final self::InlineClass #this) → () → core::int
|
|
return () → core::int => self::InlineClass|call(#this);
|
|
static method test(self::InlineClass ic) → dynamic {
|
|
core::int a = self::InlineClass|+(ic, 2);
|
|
core::int b = self::InlineClass|unary-(ic);
|
|
core::int c = self::InlineClass|[](ic, 2);
|
|
core::int d = let final self::InlineClass #t8 = ic in let final core::int #t9 = 3 in let final core::int #t10 = 42 in let final void #t11 = self::InlineClass|[]=(#t8, #t9, #t10) in #t10;
|
|
core::int e = self::InlineClass|get#getter(ic);
|
|
() → core::int f = self::InlineClass|get#method(ic);
|
|
core::int g = let final core::int #t12 = 42 in let final void #t13 = self::InlineClass|set#setter(ic, #t12) in #t12;
|
|
self::InlineClass|set#setter(ic, 87);
|
|
(core::int) → core::int h = self::InlineClass|get#genericMethod(ic)<core::int>;
|
|
invalid-expression "pkg/front_end/testcases/inline_class/method_access.dart:77:6: Error: The getter 'setter' isn't defined for the class 'InlineClass'.
|
|
Try correcting the name to the name of an existing getter, or defining a getter or field named 'setter'.
|
|
ic.setter; // Error, should not resolve to extension method.
|
|
^^^^^^" in ic{<unresolved>}.setter;
|
|
invalid-expression "pkg/front_end/testcases/inline_class/method_access.dart:78:6: Error: The setter 'getter' isn't defined for the class 'InlineClass'.
|
|
Try correcting the name to the name of an existing setter, or defining a setter or field named 'getter'.
|
|
ic.getter = 42; // Error, should not resolve to extension method.
|
|
^^^^^^" in ic{<unresolved>}.getter = 42;
|
|
core::int i = self::InlineClass|method(ic);
|
|
core::num j = self::InlineClass|genericMethod<core::num>(ic, 0);
|
|
core::int k = self::InlineClass|genericMethod<core::int>(ic, 0);
|
|
core::num l = self::InlineClass|genericMethod<core::num>(ic, 0);
|
|
core::int m = self::InlineClass|call(ic);
|
|
core::int n = self::InlineClass|call(ic);
|
|
}
|