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

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

Issue 3004163002: Don't treat typedef-typed formal parameters as funtion-type from resynthesize from Kernel. (Closed)
Patch Set: Created 3 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/summary/resynthesize_kernel_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 8463 matching lines...) Expand 10 before | Expand all | Expand 10 after
8474 } 8474 }
8475 8475
8476 /** 8476 /**
8477 * If this element is resynthesized, and its type and parameters have not 8477 * If this element is resynthesized, and its type and parameters have not
8478 * been build yet, build them and remember in the corresponding fields. 8478 * been build yet, build them and remember in the corresponding fields.
8479 */ 8479 */
8480 void _resynthesizeTypeAndParameters() { 8480 void _resynthesizeTypeAndParameters() {
8481 if (_kernel != null && _type == null) { 8481 if (_kernel != null && _type == null) {
8482 kernel.DartType type = _kernel.type; 8482 kernel.DartType type = _kernel.type;
8483 _type = enclosingUnit._kernelContext.getType(this, type); 8483 _type = enclosingUnit._kernelContext.getType(this, type);
8484 if (type is kernel.FunctionType) { 8484 if (type is kernel.FunctionType && type.typedefReference == null) {
8485 _parameters = new List<ParameterElement>( 8485 _parameters = new List<ParameterElement>(
8486 type.positionalParameters.length + type.namedParameters.length); 8486 type.positionalParameters.length + type.namedParameters.length);
8487 int index = 0; 8487 int index = 0;
8488 for (int i = 0; i < type.positionalParameters.length; i++) { 8488 for (int i = 0; i < type.positionalParameters.length; i++) {
8489 String name = i < type.positionalParameterNames.length 8489 String name = i < type.positionalParameterNames.length
8490 ? type.positionalParameterNames[i] 8490 ? type.positionalParameterNames[i]
8491 : null; 8491 : null;
8492 _parameters[index++] = new ParameterElementImpl.forKernel( 8492 _parameters[index++] = new ParameterElementImpl.forKernel(
8493 enclosingElement, 8493 enclosingElement,
8494 new kernel.VariableDeclaration(name, 8494 new kernel.VariableDeclaration(name,
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
10015 10015
10016 @override 10016 @override
10017 DartObject computeConstantValue() => null; 10017 DartObject computeConstantValue() => null;
10018 10018
10019 @override 10019 @override
10020 void visitChildren(ElementVisitor visitor) { 10020 void visitChildren(ElementVisitor visitor) {
10021 super.visitChildren(visitor); 10021 super.visitChildren(visitor);
10022 _initializer?.accept(visitor); 10022 _initializer?.accept(visitor);
10023 } 10023 }
10024 } 10024 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698