| Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| index da2410cf4b94d2816d4e3e996952fb7e19e0792f..34abf39f1448a759231453a3097c419af93e819f 100644
|
| --- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| @@ -276,17 +276,25 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
|
| visitSimpleIdentifier(SimpleIdentifier node) {
|
| super.visitSimpleIdentifier(node);
|
| Element element = node.staticElement;
|
| - if (element is LocalVariableElement && node.inGetterContext()) {
|
| - int offset = node.offset;
|
| - DartType type = node.staticType;
|
| - if (identical(type, element.type)) {
|
| - _instrumentation.record(uri, offset, 'promotedType',
|
| - const fasta.InstrumentationValueLiteral('none'));
|
| - } else {
|
| - _instrumentation.record(uri, offset, 'promotedType',
|
| - new _InstrumentationValueForType(type));
|
| + void recordPromotions(DartType elementType) {
|
| + if (node.inGetterContext() && !node.inDeclarationContext()) {
|
| + int offset = node.offset;
|
| + DartType type = node.staticType;
|
| + if (identical(type, elementType)) {
|
| + _instrumentation.record(uri, offset, 'promotedType',
|
| + const fasta.InstrumentationValueLiteral('none'));
|
| + } else {
|
| + _instrumentation.record(uri, offset, 'promotedType',
|
| + new _InstrumentationValueForType(type));
|
| + }
|
| }
|
| }
|
| +
|
| + if (element is LocalVariableElement) {
|
| + recordPromotions(element.type);
|
| + } else if (element is ParameterElement) {
|
| + recordPromotions(element.type);
|
| + }
|
| }
|
|
|
| visitVariableDeclarationList(VariableDeclarationList node) {
|
|
|