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

Unified Diff: pkg/analyzer/lib/src/generated/element.dart

Issue 696293003: Add debugging for issues 21013 and 21014 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element.dart
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index dd67ae1cfcca48e5077baac73abb569af9648fc5..6025f072f9c4f24809d08171eff9cf63959fedd6 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.dart
@@ -10036,6 +10036,11 @@ class PropertyAccessorMember extends ExecutableMember implements PropertyAccesso
List<DartType> argumentTypes = definingType.typeArguments;
if (baseAccessor != null && argumentTypes.length != 0) {
FunctionType baseType = baseAccessor.type;
+ if (baseType == null) {
+ AnalysisEngine.instance.logger.logInformation(
+ 'Type of $baseAccessor is null in PropertyAccessorMember._isChangedByTypeSubstitution');
+ return false;
+ }
List<DartType> parameterTypes = definingType.element.type.typeArguments;
FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
if (baseType != substitutedType) {
@@ -10679,16 +10684,31 @@ class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements
}
/**
- * The abstract class `TypeImpl` implements the behavior common to objects representing the
- * declared type of elements in the element model.
+ * The abstract class `TypeImpl` implements the behavior common to objects
+ * representing the declared type of elements in the element model.
*/
abstract class TypeImpl implements DartType {
- static bool equalArrays(List<DartType> typeArgs1, List<DartType> typeArgs2, Set<ElementPair> visitedElementPairs) {
- if (typeArgs1.length != typeArgs2.length) {
+ /**
+ * Return `true` if corresponding elements of the [first] and [second] lists
+ * of type arguments are all equal. Use the set of [visitedElementPairs] to
+ * prevent infinite loops when the types are recursively defined.
+ */
+ static bool equalArrays(List<DartType> first, List<DartType> second,
+ Set<ElementPair> visitedElementPairs) {
+ if (first.length != second.length) {
return false;
}
- for (int i = 0; i < typeArgs1.length; i++) {
- if (!(typeArgs1[i] as TypeImpl).internalEquals(typeArgs2[i], visitedElementPairs)) {
+ for (int i = 0; i < first.length; i++) {
+ if (first[i] == null) {
+ AnalysisEngine.instance.logger.logInformation(
+ 'Found null type argument in TypeImpl.equalArrays');
+ return second[i] == null;
+ } else if (second[i] == null) {
+ AnalysisEngine.instance.logger.logInformation(
+ 'Found null type argument in TypeImpl.equalArrays');
+ return false;
+ }
+ if (!(first[i] as TypeImpl).internalEquals(second[i], visitedElementPairs)) {
return false;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698