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

Side by Side Diff: frog/gen.dart

Issue 8826014: frog: generalize checking that type args aren't used in static methods (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/member.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Top level generator object for writing code and keeping track of 6 * Top level generator object for writing code and keeping track of
7 * dependencies. 7 * dependencies.
8 * 8 *
9 * Should have two compilation models, but only one implemented so far. 9 * Should have two compilation models, but only one implemented so far.
10 * 10 *
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 typeRef = new NameTypeReference( 2102 typeRef = new NameTypeReference(
2103 typeRef.isFinal, typeRef.name, names, typeRef.span); 2103 typeRef.isFinal, typeRef.name, names, typeRef.span);
2104 } 2104 }
2105 2105
2106 var type = method.resolveType(typeRef, true); 2106 var type = method.resolveType(typeRef, true);
2107 if (type.isTop) { 2107 if (type.isTop) {
2108 type = type.library.findTypeByName(constructorName); 2108 type = type.library.findTypeByName(constructorName);
2109 constructorName = ''; 2109 constructorName = '';
2110 } 2110 }
2111 2111
2112 if (method.isStatic 2112 if (type is ParameterType) {
2113 && ((method.typeParameters === null && type.hasTypeParams)
2114 || type is ParameterType)) {
2115 world.error('using type parameter in static context', node.span);
2116 return _makeMissingValue(constructorName);
2117 } else if (type is ParameterType) {
2118 world.error('cannot instantiate a type parameter', node.span); 2113 world.error('cannot instantiate a type parameter', node.span);
2119 return _makeMissingValue(constructorName); 2114 return _makeMissingValue(constructorName);
2120 } 2115 }
2121 2116
2122 var m = type.getConstructor(constructorName); 2117 var m = type.getConstructor(constructorName);
2123 if (m == null) { 2118 if (m == null) {
2124 var name = type.jsname; 2119 var name = type.jsname;
2125 if (type.isVar) { 2120 if (type.isVar) {
2126 name = typeRef.name.name; 2121 name = typeRef.name.name;
2127 } 2122 }
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2473 result.add(new Value(world.varType, '\$$i', null, /*needsTemp:*/false)); 2468 result.add(new Value(world.varType, '\$$i', null, /*needsTemp:*/false));
2474 } 2469 }
2475 for (int i = bareCount; i < length; i++) { 2470 for (int i = bareCount; i < length; i++) {
2476 var name = getName(i); 2471 var name = getName(i);
2477 if (name == null) name = '\$$i'; 2472 if (name == null) name = '\$$i';
2478 result.add(new Value(world.varType, name, null, /*needsTemp:*/false)); 2473 result.add(new Value(world.varType, name, null, /*needsTemp:*/false));
2479 } 2474 }
2480 return new Arguments(nodes, result); 2475 return new Arguments(nodes, result);
2481 } 2476 }
2482 } 2477 }
OLDNEW
« no previous file with comments | « no previous file | frog/member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698