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

Unified Diff: frog/gen.dart

Issue 8826001: frog bug 642: type variables can't be used in allocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 9 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 | frog/minfrog » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/gen.dart
diff --git a/frog/gen.dart b/frog/gen.dart
index efb7f07164848ba44297b43c6f5dfc98a1b5ff4b..ceb3b403d573fa0f8ab66d3294b3e7fc4322af19 100644
--- a/frog/gen.dart
+++ b/frog/gen.dart
@@ -2109,6 +2109,16 @@ class MethodGenerator implements TreeVisitor {
constructorName = '';
}
+ if (method.isStatic
+ && ((method.typeParameters === null && type.hasTypeParams)
Jennifer Messerly 2011/12/06 22:14:55 I don't understand the (method.typeParameters ===
+ || type is ParameterType)) {
+ world.error('using type parameter in static context', node.span);
+ return _makeMissingValue(constructorName);
+ } else if (type is ParameterType) {
+ world.error('cannot instantiate a type parameter', node.span);
+ return _makeMissingValue(constructorName);
+ }
+
var m = type.getConstructor(constructorName);
if (m == null) {
var name = type.jsname;
« no previous file with comments | « no previous file | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698