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

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

Issue 2956923003: Fix for crash because of missing type of default generic function typed parameters. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/driver_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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.generated.declaration_resolver; 5 library analyzer.src.generated.declaration_resolver;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/token.dart'; 8 import 'package:analyzer/dart/ast/token.dart';
9 import 'package:analyzer/dart/ast/visitor.dart'; 9 import 'package:analyzer/dart/ast/visitor.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return null; 122 return null;
123 } 123 }
124 124
125 @override 125 @override
126 Object visitDefaultFormalParameter(DefaultFormalParameter node) { 126 Object visitDefaultFormalParameter(DefaultFormalParameter node) {
127 NormalFormalParameter normalParameter = node.parameter; 127 NormalFormalParameter normalParameter = node.parameter;
128 ParameterElement element = 128 ParameterElement element =
129 _match(normalParameter.identifier, _walker.getParameter()); 129 _match(normalParameter.identifier, _walker.getParameter());
130 if (normalParameter is SimpleFormalParameterImpl) { 130 if (normalParameter is SimpleFormalParameterImpl) {
131 normalParameter.element = element; 131 normalParameter.element = element;
132 _setGenericFunctionType(normalParameter.type, element.type);
132 } 133 }
133 Expression defaultValue = node.defaultValue; 134 Expression defaultValue = node.defaultValue;
134 if (defaultValue != null) { 135 if (defaultValue != null) {
135 _walk( 136 _walk(
136 new ElementWalker.forExecutable(element.initializer, _enclosingUnit), 137 new ElementWalker.forExecutable(element.initializer, _enclosingUnit),
137 () { 138 () {
138 defaultValue.accept(this); 139 defaultValue.accept(this);
139 }); 140 });
140 } 141 }
141 _walk(new ElementWalker.forParameter(element), () { 142 _walk(new ElementWalker.forParameter(element), () {
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 class _ElementMismatchException extends AnalysisException { 815 class _ElementMismatchException extends AnalysisException {
815 /** 816 /**
816 * Creates an exception to refer to the given [compilationUnit], [element], 817 * Creates an exception to refer to the given [compilationUnit], [element],
817 * and [cause]. 818 * and [cause].
818 */ 819 */
819 _ElementMismatchException( 820 _ElementMismatchException(
820 CompilationUnitElement compilationUnit, Element element, 821 CompilationUnitElement compilationUnit, Element element,
821 [CaughtException cause = null]) 822 [CaughtException cause = null])
822 : super('Element mismatch in $compilationUnit at $element', cause); 823 : super('Element mismatch in $compilationUnit at $element', cause);
823 } 824 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698