c878108cc8
All non-pubspec changes generated by `dart format pkg/compiler`. Change-Id: Iadaa70974816d96ccb47813fe72d5a2bb83d6bda Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400181 Reviewed-by: Nate Biggs <natebiggs@google.com> Commit-Queue: Mayank Patke <fishythefish@google.com>
57 lines
1.1 KiB
Dart
57 lines
1.1 KiB
Dart
// Copyright (c) 2019, 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.
|
|
|
|
class MyClass {
|
|
MyClass();
|
|
|
|
@pragma('dart2js:noInline')
|
|
set internalSetter(int v) {
|
|
/*7:MyClass.internalSetter*/
|
|
throw "error";
|
|
}
|
|
}
|
|
|
|
int q = 3;
|
|
|
|
extension Ext on MyClass {
|
|
@pragma('dart2js:noInline')
|
|
int method() {
|
|
this. /*6:Ext.method*/ internalSetter = 1;
|
|
return 0;
|
|
}
|
|
|
|
@pragma('dart2js:noInline')
|
|
int get propertyB => /*5:Ext.propertyB*/ method();
|
|
|
|
@pragma('dart2js:noInline')
|
|
set propertyA(int v) {
|
|
/*4:Ext.propertyA*/
|
|
propertyB;
|
|
}
|
|
|
|
@pragma('dart2js:noInline')
|
|
int operator +(int v) {
|
|
this. /*3:Ext.+*/ propertyA = 2;
|
|
return 1;
|
|
}
|
|
|
|
@pragma('dart2js:noInline')
|
|
int operator [](int v) => this /*2:Ext.[]*/ + 2;
|
|
}
|
|
|
|
extension on MyClass {
|
|
@pragma('dart2js:noInline')
|
|
int method2() => this /*1:MyClass.<anonymous extension>.method2*/ [0];
|
|
}
|
|
|
|
@pragma('dart2js:noInline')
|
|
confuse(x) => x;
|
|
|
|
main() {
|
|
q++;
|
|
confuse(null);
|
|
MyClass x = confuse(new MyClass());
|
|
x. /*0:main*/ method2();
|
|
}
|