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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10546136: Report error if typedef references itself in type parameter bounds (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 7353f9c9783e49d594f94eca9ed3cd9244e0df89..c7815476b0e5446c4e45510b222881d4cb364309 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -2319,6 +2319,14 @@ public class TypeAnalyzer implements DartCompilationPhase {
// prepare Types directly referenced by "current"
Set<Type> referencedTypes = Sets.newHashSet();
if (type != null) {
+ // type parameters
+ for (Type typeParameter : current.getTypeParameters()) {
+ if (typeParameter instanceof TypeVariable) {
+ TypeVariable typeVariable = (TypeVariable) typeParameter;
+ Type bound = typeVariable.getTypeVariableElement().getBound();
+ referencedTypes.add(bound);
Brian Wilkerson 2012/06/13 04:31:38 Do we need a null test in case there is no bound,
scheglov 2012/06/13 13:38:20 We have null test later in cycle.
+ }
+ }
// return type
referencedTypes.add(type.getReturnType());
// parameters
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698