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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 17076002: Type check initializer lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type inference. Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import 'dart:collection' show LinkedHashMap; 7 import 'dart:collection' show LinkedHashMap;
8 8
9 import 'elements.dart'; 9 import 'elements.dart';
10 import '../../compiler.dart' as api; 10 import '../../compiler.dart' as api;
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 */ 961 */
962 class FieldParameterElementX extends VariableElementX 962 class FieldParameterElementX extends VariableElementX
963 implements FieldParameterElement { 963 implements FieldParameterElement {
964 VariableElement fieldElement; 964 VariableElement fieldElement;
965 965
966 FieldParameterElementX(SourceString name, 966 FieldParameterElementX(SourceString name,
967 this.fieldElement, 967 this.fieldElement,
968 VariableListElement variables, 968 VariableListElement variables,
969 Node node) 969 Node node)
970 : super(name, variables, ElementKind.FIELD_PARAMETER, node); 970 : super(name, variables, ElementKind.FIELD_PARAMETER, node);
971
972 DartType computeType(Compiler compiler) {
973 VariableDefinitions definitions = variables.parseNode(compiler);
974 if (definitions.type == null && !definitions.modifiers.isVar()) {
ngeoffray 2013/07/12 09:34:03 Maybe add a comment on where in the spec this is?
975 return fieldElement.computeType(compiler);
976 }
977 return super.computeType(compiler);
978 }
971 } 979 }
972 980
973 // This element represents a list of variable or field declaration. 981 // This element represents a list of variable or field declaration.
974 // It contains the node, and the type. A [VariableElement] always 982 // It contains the node, and the type. A [VariableElement] always
975 // references its [VariableListElement]. It forwards its 983 // references its [VariableListElement]. It forwards its
976 // [computeType] and [parseNode] methods to this element. 984 // [computeType] and [parseNode] methods to this element.
977 class VariableListElementX extends ElementX implements VariableListElement { 985 class VariableListElementX extends ElementX implements VariableListElement {
978 VariableDefinitions cachedNode; 986 VariableDefinitions cachedNode;
979 DartType type; 987 DartType type;
980 final Modifiers modifiers; 988 final Modifiers modifiers;
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 2216
2209 MetadataAnnotation ensureResolved(Compiler compiler) { 2217 MetadataAnnotation ensureResolved(Compiler compiler) {
2210 if (resolutionState == STATE_NOT_STARTED) { 2218 if (resolutionState == STATE_NOT_STARTED) {
2211 compiler.resolver.resolveMetadataAnnotation(this); 2219 compiler.resolver.resolveMetadataAnnotation(this);
2212 } 2220 }
2213 return this; 2221 return this;
2214 } 2222 }
2215 2223
2216 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 2224 String toString() => 'MetadataAnnotation($value, $resolutionState)';
2217 } 2225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698