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

Unified Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2511753002: Fix crash while inferencing instance field type. (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/link.dart
diff --git a/pkg/analyzer/lib/src/summary/link.dart b/pkg/analyzer/lib/src/summary/link.dart
index 87828c393b44993dd6d8f2e77ba6b275536bea97..d24569a3dfe2b5d9943ef2b9547b31765ae72360 100644
--- a/pkg/analyzer/lib/src/summary/link.dart
+++ b/pkg/analyzer/lib/src/summary/link.dart
@@ -2962,6 +2962,9 @@ class FunctionElementForLink_Initializer extends Object
.toList();
@override
+ String get identifier => '';
+
+ @override
DartType get returnType {
// If this is a variable whose type needs inferring, infer it.
if (_variable.hasImplicitType) {
@@ -3085,6 +3088,18 @@ class FunctionElementForLink_Local_NonSynthetic extends ExecutableElementForLink
.toList();
@override
+ String get identifier {
+ String identifier = _unlinkedExecutable.name;
+ Element enclosing = this.enclosingElement;
+ if (enclosing is ExecutableElement) {
+ int id =
+ ElementImpl.findElementIndexUsingIdentical(enclosing.functions, this);
+ identifier += "@$id";
+ }
+ return identifier;
+ }
+
+ @override
bool get _hasTypeBeenInferred => _inferredReturnType != null;
@override
@@ -4981,6 +4996,9 @@ abstract class VariableElementForLink
@override
bool get hasImplicitType => unlinkedVariable.type == null;
+ @override
+ String get identifier => unlinkedVariable.name;
+
/**
* Return the inferred type of the variable element. Should only be called if
* no type was explicitly declared.
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698