Chromium Code Reviews| 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; |