Files
sdk/pkg/front_end/testcases/dartdevc/instance_getter_invocation.dart.strong.transformed.expect
T
Johnni Winther 92e237c835 [cfe,dartdevc,dart2js] Use InstanceGetterInvocation for getter/field invocation
The web compilers don't support getter/field invocation encoded as a
FunctionInvocation on an InstanceGet because it doesn't work for
getter/field invocation of js-interop properties, since the InstanceGet
wouldn't result in a Dart function but just JavaScript function.

To support this in the new method invocation encoding, a special
expression, InstanceGetterInvocation, is used to encode getter/field
invocations in dart2js and ddc.

Change-Id: I21da8e8686f66ae4ce4d44245073b9e424f975b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192181
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-23 09:49:06 +00:00

32 lines
1.3 KiB
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class Class extends core::Object {
synthetic constructor •() → self::Class
: super core::Object::•()
;
get idFunction() → <S extends core::Object? = dynamic>(S%) → S%
return #C1;
get dynFunction() → dynamic
return #C1;
}
static method id<T extends core::Object? = dynamic>(self::id::T% t) → self::id::T%
return t;
static method main() → dynamic {
self::Class c = new self::Class::•();
let final self::Class #t1 = c in let final core::int #t2 = 0 in #t1.{self::Class::idFunction}<core::int>(#t2){(core::int) → core::int};
let final self::Class #t3 = c in let final core::int #t4 = 0 in #t3.{self::Class::idFunction}<core::int>(#t4){(core::int) → core::int};
let final self::Class #t5 = c in let final core::int #t6 = 0 in #t5.{self::Class::dynFunction}(#t6);
}
constants {
#C1 = tearoff self::id
}
Extra constant evaluation status:
Evaluated: VariableGet @ org-dartlang-testcase:///instance_getter_invocation.dart:14:16 -> DoubleConstant(0.0)
Evaluated: VariableGet @ org-dartlang-testcase:///instance_getter_invocation.dart:15:21 -> DoubleConstant(0.0)
Evaluated: VariableGet @ org-dartlang-testcase:///instance_getter_invocation.dart:16:17 -> DoubleConstant(0.0)
Extra constant evaluation: evaluated: 20, effectively constant: 3