Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2346143003: fix #27363, support `@checked` on fields (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 7180 matching lines...) Expand 10 before | Expand all | Expand 10 after
7191 ParameterElementImpl_ofImplicitSetter( 7191 ParameterElementImpl_ofImplicitSetter(
7192 PropertyAccessorElementImpl_ImplicitSetter setter) 7192 PropertyAccessorElementImpl_ImplicitSetter setter)
7193 : setter = setter, 7193 : setter = setter,
7194 super('_${setter.variable.name}', setter.variable.nameOffset) { 7194 super('_${setter.variable.name}', setter.variable.nameOffset) {
7195 enclosingElement = setter; 7195 enclosingElement = setter;
7196 synthetic = true; 7196 synthetic = true;
7197 parameterKind = ParameterKind.REQUIRED; 7197 parameterKind = ParameterKind.REQUIRED;
7198 } 7198 }
7199 7199
7200 @override 7200 @override
7201 bool get isCovariant {
7202 if (inheritsCovariant) {
7203 return true;
7204 }
7205 for (ElementAnnotationImpl annotation in setter.variable.metadata) {
7206 if (annotation.isCovariant) {
7207 return true;
7208 }
7209 }
7210 return false;
7211 }
7212
7213 @override
7201 DartType get type => setter.variable.type; 7214 DartType get type => setter.variable.type;
7202 7215
7203 @override 7216 @override
7204 void set type(DartType type) { 7217 void set type(DartType type) {
7205 assert(false); // Should never be called. 7218 assert(false); // Should never be called.
7206 } 7219 }
7207 } 7220 }
7208 7221
7209 /** 7222 /**
7210 * A mixin that provides a common implementation for methods defined in 7223 * A mixin that provides a common implementation for methods defined in
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
8351 8364
8352 @override 8365 @override
8353 void visitElement(Element element) { 8366 void visitElement(Element element) {
8354 int offset = element.nameOffset; 8367 int offset = element.nameOffset;
8355 if (offset != -1) { 8368 if (offset != -1) {
8356 map[offset] = element; 8369 map[offset] = element;
8357 } 8370 }
8358 super.visitElement(element); 8371 super.visitElement(element);
8359 } 8372 }
8360 } 8373 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698