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

Side by Side Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 1714463002: Compare variable initializers as functions, skip the return type. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 * If the given [serializedInitializer] is not `null`, create the 1757 * If the given [serializedInitializer] is not `null`, create the
1758 * corresponding [FunctionElementImpl] and set it for the [variable]. 1758 * corresponding [FunctionElementImpl] and set it for the [variable].
1759 */ 1759 */
1760 void buildVariableInitializer( 1760 void buildVariableInitializer(
1761 VariableElementImpl variable, UnlinkedExecutable serializedInitializer) { 1761 VariableElementImpl variable, UnlinkedExecutable serializedInitializer) {
1762 if (serializedInitializer == null) { 1762 if (serializedInitializer == null) {
1763 return null; 1763 return null;
1764 } 1764 }
1765 FunctionElementImpl initializerElement = 1765 FunctionElementImpl initializerElement =
1766 buildLocalFunction(serializedInitializer); 1766 buildLocalFunction(serializedInitializer);
1767 // TODO(scheglov) The flag `hasImplicitReturnType` is `true` now because we
Paul Berry 2016/02/18 16:40:00 FYI, I'm about to make a change to the element mod
1768 // don't serialize the return type. But once we do, the next two statements
1769 // can be removed.
1770 assert(initializerElement.hasImplicitReturnType == true);
1771 initializerElement.hasImplicitReturnType = false;
1767 initializerElement.synthetic = true; 1772 initializerElement.synthetic = true;
1768 variable.initializer = initializerElement; 1773 variable.initializer = initializerElement;
1769 } 1774 }
1770 1775
1771 /** 1776 /**
1772 * Finish creating a [TypeParameterElement] by deserializing its bound. 1777 * Finish creating a [TypeParameterElement] by deserializing its bound.
1773 */ 1778 */
1774 void finishTypeParameter(UnlinkedTypeParam serializedTypeParameter, 1779 void finishTypeParameter(UnlinkedTypeParam serializedTypeParameter,
1775 TypeParameterElementImpl typeParameterElement) { 1780 TypeParameterElementImpl typeParameterElement) {
1776 if (serializedTypeParameter.bound != null) { 1781 if (serializedTypeParameter.bound != null) {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 } 2232 }
2228 : () => this.element; 2233 : () => this.element;
2229 // TODO(paulberry): Is it a bug that we have to pass `false` for 2234 // TODO(paulberry): Is it a bug that we have to pass `false` for
2230 // isInstantiated? 2235 // isInstantiated?
2231 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); 2236 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false);
2232 } else { 2237 } else {
2233 return null; 2238 return null;
2234 } 2239 }
2235 } 2240 }
2236 } 2241 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698