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

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

Issue 2835903003: Issue 29388. Resynthesize non-generic types for ReferenceInfo lazily. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 234f46a35500c80a0cf52cb9eedf062b992666de..809471ec5483056385a757e54824ea8c27889611 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -1221,7 +1221,7 @@ class _ReferenceInfo {
* If this reference refers to a non-generic type, the type it refers to.
* Otherwise `null`.
*/
- DartType type;
+ DartType _type;
/**
* The number of type parameters accepted by the entity referred to by this
@@ -1247,10 +1247,19 @@ class _ReferenceInfo {
DartType specialType,
this.numTypeParameters) {
if (specialType != null) {
- type = specialType;
- } else {
- type = _buildType(true, 0, (_) => DynamicTypeImpl.instance, const []);
+ _type = specialType;
+ }
+ }
+
+ /**
+ * If this reference refers to a non-generic type, the type it refers to.
+ * Otherwise `null`.
+ */
+ DartType get type {
+ if (_type == null) {
+ _type = _buildType(true, 0, (_) => DynamicTypeImpl.instance, const []);
}
+ return _type;
}
/**
@@ -1338,11 +1347,18 @@ class _ReferenceInfo {
typeArguments =
_buildTypeArguments(numTypeArguments, getTypeArgument);
} else if (libraryResynthesizer.summaryResynthesizer.strongMode &&
- instantiateToBoundsAllowed) {
+ instantiateToBoundsAllowed
+// && !_isBeingInstantiatedToBounds
Brian Wilkerson 2017/04/24 18:35:47 Should we remove the commented out code?
+ ) {
+// _isBeingInstantiatedToBounds = true;
+// try {
FunctionType instantiatedToBounds = libraryResynthesizer
.summaryResynthesizer.context.typeSystem
.instantiateToBounds(element.type) as FunctionType;
typeArguments = instantiatedToBounds.typeArguments;
+// } finally {
+// _isBeingInstantiatedToBounds = false;
+// }
} else {
typeArguments = new List<DartType>.filled(
numTypeParameters, DynamicTypeImpl.instance);
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698