e057dddc73
Years are the earliest year that can be reliably tracked using 'blame'. TBR=sigmund@google.com Change-Id: I1a7e650469a83d79e6eb65be899a5955dc74e1d4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239620 Reviewed-by: Sigmund Cherem <sigmund@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com>
57 lines
1.2 KiB
Dart
57 lines
1.2 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.
|
|
|
|
// @dart = 2.7
|
|
|
|
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();
|
|
}
|