Chromium Code Reviews

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1371813002: infer field formal parameter types (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong_mode.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 engine.resolver; 5 library engine.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'ast.dart'; 9 import 'ast.dart';
10 import 'constant.dart'; 10 import 'constant.dart';
(...skipping 13993 matching lines...)
14004 Object visitFieldFormalParameter(FieldFormalParameter node) { 14004 Object visitFieldFormalParameter(FieldFormalParameter node) {
14005 super.visitFieldFormalParameter(node); 14005 super.visitFieldFormalParameter(node);
14006 Element element = node.identifier.staticElement; 14006 Element element = node.identifier.staticElement;
14007 if (element is ParameterElementImpl) { 14007 if (element is ParameterElementImpl) {
14008 ParameterElementImpl parameter = element; 14008 ParameterElementImpl parameter = element;
14009 FormalParameterList parameterList = node.parameters; 14009 FormalParameterList parameterList = node.parameters;
14010 if (parameterList == null) { 14010 if (parameterList == null) {
14011 DartType type; 14011 DartType type;
14012 TypeName typeName = node.type; 14012 TypeName typeName = node.type;
14013 if (typeName == null) { 14013 if (typeName == null) {
14014 element.hasImplicitType = true;
14014 type = _dynamicType; 14015 type = _dynamicType;
14015 if (parameter is FieldFormalParameterElement) { 14016 if (parameter is FieldFormalParameterElement) {
14016 FieldElement fieldElement = 14017 FieldElement fieldElement =
14017 (parameter as FieldFormalParameterElement).field; 14018 (parameter as FieldFormalParameterElement).field;
14018 if (fieldElement != null) { 14019 if (fieldElement != null) {
14019 type = fieldElement.type; 14020 type = fieldElement.type;
14020 } 14021 }
14021 } 14022 }
14022 } else { 14023 } else {
14023 type = _getType(typeName); 14024 type = _getType(typeName);
(...skipping 1923 matching lines...)
15947 nonFields.add(node); 15948 nonFields.add(node);
15948 return null; 15949 return null;
15949 } 15950 }
15950 15951
15951 @override 15952 @override
15952 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 15953 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
15953 15954
15954 @override 15955 @override
15955 Object visitWithClause(WithClause node) => null; 15956 Object visitWithClause(WithClause node) => null;
15956 } 15957 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/strong_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine