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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 118273004: Handle typedefs in registerRequiredType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 9151b71b64d9c5716c39bb68541acdd54f0cf6f0..875a1d38ba277b2e73575643b72becf21f60c65f 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -1010,29 +1010,14 @@ class JavaScriptBackend extends Backend {
* If [argument] has type variables or is a type variable, this
* method registers a RTI dependency between the class where the
* type variable is defined (that is the enclosing class of the
- * current element being resolved) and the class of [annotation].
- * If the class of [annotation] requires RTI, then the class of
+ * current element being resolved) and the class of [type].
+ * If the class of [type] requires RTI, then the class of
* the type variable does too.
*/
- void analyzeTypeArgument(DartType annotation, DartType argument) {
- if (argument == null) return;
- if (argument.element.isTypeVariable()) {
- ClassElement enclosing = argument.element.getEnclosingClass();
- assert(enclosing == enclosingElement.getEnclosingClass().declaration);
- rti.registerRtiDependency(annotation.element, enclosing);
- } else if (argument is InterfaceType) {
- InterfaceType type = argument;
- type.typeArguments.forEach((DartType argument) {
- analyzeTypeArgument(annotation, argument);
- });
- }
- }
-
- if (type is InterfaceType) {
- InterfaceType itf = type;
- itf.typeArguments.forEach((DartType argument) {
- analyzeTypeArgument(type, argument);
- });
+ ClassElement contextClass = Types.getClassContext(type);
+ if (contextClass != null) {
+ assert(contextClass == enclosingElement.getEnclosingClass().declaration);
+ rti.registerRtiDependency(type.element, contextClass);
}
}
« 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