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

Unified Diff: pkg/polymer/lib/src/mirror_loader.dart

Issue 219433004: Fix mirror_loader to detect whether the type is a generic class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « pkg/pkg.status ('k') | pkg/polymer/test/mirror_loader_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/mirror_loader.dart
diff --git a/pkg/polymer/lib/src/mirror_loader.dart b/pkg/polymer/lib/src/mirror_loader.dart
index c450b8329128cc716c5bf4f4bbfa0ed569bc31bb..f27a4d30c468c476b72636a641af0cedd6ef9971 100644
--- a/pkg/polymer/lib/src/mirror_loader.dart
+++ b/pkg/polymer/lib/src/mirror_loader.dart
@@ -162,7 +162,8 @@ void _loadLibrary(String uriString, List<Function> initializers) {
void _loadCustomTags(LibraryMirror lib, ClassMirror cls,
LinkedHashMap registerFns) {
- if (cls == null || cls.reflectedType == HtmlElement) return;
+ if (cls == null) return;
+ if (cls.hasReflectedType && cls.reflectedType == HtmlElement) return;
// Register superclass first.
_loadCustomTags(lib, cls.superclass, registerFns);
@@ -177,6 +178,13 @@ void _loadCustomTags(LibraryMirror lib, ClassMirror cls,
var meta = _getCustomTagMetadata(cls);
if (meta == null) return;
+ if (!cls.hasReflectedType) {
+ var name = MirrorSystem.getName(cls.simpleName);
+ new Completer().completeError(new UnsupportedError('Custom element classes '
+ 'cannot have type-parameters: $name'));
+ return;
+ }
+
registerFns.putIfAbsent(cls.reflectedType, () =>
() => Polymer.register(meta.tagName, cls.reflectedType));
}
« no previous file with comments | « pkg/pkg.status ('k') | pkg/polymer/test/mirror_loader_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698