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

Side by Side Diff: frog/analyze.dart

Issue 9463006: Fix issue 1833 by reporting an error if the type is not found. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 * A simple code analyzer for Dart. 6 * A simple code analyzer for Dart.
7 * 7 *
8 * Currently used to ensure all concrete generic types are visited. 8 * Currently used to ensure all concrete generic types are visited.
9 * Also performs all static type checks - so these don't need to be 9 * Also performs all static type checks - so these don't need to be
10 * done in later phases. 10 * done in later phases.
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 constructorName = names.removeLast().name; 594 constructorName = names.removeLast().name;
595 if (names.length == 0) names = null; 595 if (names.length == 0) names = null;
596 596
597 typeRef = new NameTypeReference( 597 typeRef = new NameTypeReference(
598 typeRef.isFinal, typeRef.name, names, typeRef.span); 598 typeRef.isFinal, typeRef.name, names, typeRef.span);
599 } 599 }
600 600
601 var type = resolveType(typeRef, true, true); 601 var type = resolveType(typeRef, true, true);
602 if (type.isTop) { 602 if (type.isTop) {
603 type = type.library.findTypeByName(constructorName); 603 type = type.library.findTypeByName(constructorName);
604 if (type == null) {
605 world.error('cannot resolve type $constructorName', node.span);
606 }
604 constructorName = ''; 607 constructorName = '';
605 } 608 }
606 609
607 if (type is ParameterType) { 610 if (type is ParameterType) {
608 world.error('cannot instantiate a type parameter', node.span); 611 world.error('cannot instantiate a type parameter', node.span);
609 return _frame._makeValue(world.varType, node); 612 return _frame._makeValue(world.varType, node);
610 } 613 }
611 614
612 var m = type.getConstructor(constructorName); 615 var m = type.getConstructor(constructorName);
613 if (m == null) { 616 if (m == null) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 for (var item in node.pieces) { 786 for (var item in node.pieces) {
784 var val = visitValue(item); 787 var val = visitValue(item);
785 var sval = val.invoke(_frame, 'toString', item, Arguments.EMPTY); 788 var sval = val.invoke(_frame, 'toString', item, Arguments.EMPTY);
786 ret = ret.binop(TokenKind.ADD, sval, _frame, item); 789 ret = ret.binop(TokenKind.ADD, sval, _frame, item);
787 } 790 }
788 return _frame._makeValue(world.stringType, node); //???ret; 791 return _frame._makeValue(world.stringType, node); //???ret;
789 */ 792 */
790 } 793 }
791 } 794 }
792 795
OLDNEW
« 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