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

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

Issue 1008583002: Fix hints (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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) 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.constant; 8 library engine.constant;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 _variableDeclarationMap = _constantFinder.variableMap; 426 _variableDeclarationMap = _constantFinder.variableMap;
427 constructorDeclarationMap = _constantFinder.constructorMap; 427 constructorDeclarationMap = _constantFinder.constructorMap;
428 _constructorInvocations = _constantFinder.constructorInvocations; 428 _constructorInvocations = _constantFinder.constructorInvocations;
429 _annotations = _constantFinder.annotations; 429 _annotations = _constantFinder.annotations;
430 _variableDeclarationMap.values.forEach((VariableDeclaration declaration) { 430 _variableDeclarationMap.values.forEach((VariableDeclaration declaration) {
431 ReferenceFinder referenceFinder = new ReferenceFinder(declaration, 431 ReferenceFinder referenceFinder = new ReferenceFinder(declaration,
432 referenceGraph, _variableDeclarationMap, constructorDeclarationMap); 432 referenceGraph, _variableDeclarationMap, constructorDeclarationMap);
433 referenceGraph.addNode(declaration); 433 referenceGraph.addNode(declaration);
434 declaration.initializer.accept(referenceFinder); 434 declaration.initializer.accept(referenceFinder);
435 }); 435 });
436 constructorDeclarationMap.forEach( 436 constructorDeclarationMap.forEach((ConstructorElement element,
437 (ConstructorElement element, ConstructorDeclaration declaration) { 437 ConstructorDeclaration declaration) {
438 ReferenceFinder referenceFinder = new ReferenceFinder(declaration, 438 ReferenceFinder referenceFinder = new ReferenceFinder(declaration,
439 referenceGraph, _variableDeclarationMap, constructorDeclarationMap); 439 referenceGraph, _variableDeclarationMap, constructorDeclarationMap);
440 referenceGraph.addNode(declaration); 440 referenceGraph.addNode(declaration);
441 bool superInvocationFound = false; 441 bool superInvocationFound = false;
442 NodeList<ConstructorInitializer> initializers = declaration.initializers; 442 NodeList<ConstructorInitializer> initializers = declaration.initializers;
443 for (ConstructorInitializer initializer in initializers) { 443 for (ConstructorInitializer initializer in initializers) {
444 if (initializer is SuperConstructorInvocation) { 444 if (initializer is SuperConstructorInvocation) {
445 superInvocationFound = true; 445 superInvocationFound = true;
446 } 446 }
447 initializer.accept(referenceFinder); 447 initializer.accept(referenceFinder);
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 if (errorTarget == null) { 855 if (errorTarget == null) {
856 // No argument node that we can direct error messages to, because we 856 // No argument node that we can direct error messages to, because we
857 // are handling an optional parameter that wasn't specified. So just 857 // are handling an optional parameter that wasn't specified. So just
858 // direct error messages to the constructor call. 858 // direct error messages to the constructor call.
859 errorTarget = node; 859 errorTarget = node;
860 } 860 }
861 if (argumentValue == null && baseParameter is ParameterElementImpl) { 861 if (argumentValue == null && baseParameter is ParameterElementImpl) {
862 // The parameter is an optional positional parameter for which no value 862 // The parameter is an optional positional parameter for which no value
863 // was provided, so use the default value. 863 // was provided, so use the default value.
864 beforeGetParameterDefault(baseParameter); 864 beforeGetParameterDefault(baseParameter);
865 EvaluationResultImpl evaluationResult = 865 EvaluationResultImpl evaluationResult = baseParameter.evaluationResult;
866 (baseParameter as ParameterElementImpl).evaluationResult;
867 if (evaluationResult == null) { 866 if (evaluationResult == null) {
868 // No default was provided, so the default value is null. 867 // No default was provided, so the default value is null.
869 argumentValue = constantVisitor.null2; 868 argumentValue = constantVisitor.null2;
870 } else if (evaluationResult.value != null) { 869 } else if (evaluationResult.value != null) {
871 argumentValue = evaluationResult.value; 870 argumentValue = evaluationResult.value;
872 } 871 }
873 } 872 }
874 if (argumentValue != null) { 873 if (argumentValue != null) {
875 if (!_runtimeTypeMatch(argumentValue, parameter.type)) { 874 if (!_runtimeTypeMatch(argumentValue, parameter.type)) {
876 errorReporter.reportErrorForNode( 875 errorReporter.reportErrorForNode(
(...skipping 4050 matching lines...) Expand 10 before | Expand all | Expand 10 after
4927 return null; 4926 return null;
4928 } 4927 }
4929 4928
4930 @override 4929 @override
4931 Object visitSimpleIdentifier(SimpleIdentifier node) { 4930 Object visitSimpleIdentifier(SimpleIdentifier node) {
4932 Element element = node.staticElement; 4931 Element element = node.staticElement;
4933 if (element is PropertyAccessorElement) { 4932 if (element is PropertyAccessorElement) {
4934 element = (element as PropertyAccessorElement).variable; 4933 element = (element as PropertyAccessorElement).variable;
4935 } 4934 }
4936 if (element is VariableElement) { 4935 if (element is VariableElement) {
4937 VariableElement variable = element as VariableElement; 4936 if (element.isConst) {
4938 if (variable.isConst) {
4939 VariableDeclaration variableDeclaration = 4937 VariableDeclaration variableDeclaration =
4940 _variableDeclarationMap[variable]; 4938 _variableDeclarationMap[element];
4941 // The declaration will be null when the variable is not defined in the 4939 // The declaration will be null when the variable is not defined in the
4942 // compilation units that were used to produce the 4940 // compilation units that were used to produce the
4943 // variableDeclarationMap. In such cases, the variable should already 4941 // variableDeclarationMap. In such cases, the variable should already
4944 // have a value associated with it, but we don't bother to check because 4942 // have a value associated with it, but we don't bother to check because
4945 // there's nothing we can do about it at this point. 4943 // there's nothing we can do about it at this point.
4946 if (variableDeclaration != null) { 4944 if (variableDeclaration != null) {
4947 _referenceGraph.addEdge(_source, variableDeclaration); 4945 _referenceGraph.addEdge(_source, variableDeclaration);
4948 } 4946 }
4949 } 4947 }
4950 } 4948 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
5185 return BoolState.from(_element == rightElement); 5183 return BoolState.from(_element == rightElement);
5186 } else if (rightOperand is DynamicState) { 5184 } else if (rightOperand is DynamicState) {
5187 return BoolState.UNKNOWN_VALUE; 5185 return BoolState.UNKNOWN_VALUE;
5188 } 5186 }
5189 return BoolState.FALSE_STATE; 5187 return BoolState.FALSE_STATE;
5190 } 5188 }
5191 5189
5192 @override 5190 @override
5193 String toString() => _element == null ? "-unknown-" : _element.name; 5191 String toString() => _element == null ? "-unknown-" : _element.name;
5194 } 5192 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | pkg/analyzer/lib/src/generated/element_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698