Files
sdk/pkg/front_end/testcases/dartdevc/instance_getter_invocation.dart
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

18 lines
427 B
Dart

// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
T id<T>(T t) => t;
class Class {
S Function<S>(S) get idFunction => id;
dynamic get dynFunction => id;
}
main() {
Class c = new Class();
c.idFunction(0);
c.idFunction<int>(0);
c.dynFunction(0);
}