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

Side by Side Diff: runtime/vm/class_finalizer.cc

Issue 10874071: Eliminate interface bool (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « runtime/lib/lib_impl_sources.gypi ('k') | runtime/vm/code_generator.cc » ('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) 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 #include "vm/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 const Script& script = Script::Handle(cls.script()); 1217 const Script& script = Script::Handle(cls.script());
1218 ReportError(script, cls.token_pos(), 1218 ReportError(script, cls.token_pos(),
1219 "'%s' is used where an interface or class name is expected", 1219 "'%s' is used where an interface or class name is expected",
1220 String::Handle(interface_class.Name()).ToCString()); 1220 String::Handle(interface_class.Name()).ToCString());
1221 } 1221 }
1222 // Verify that unless cls belongs to core lib, it cannot extend or implement 1222 // Verify that unless cls belongs to core lib, it cannot extend or implement
1223 // any of bool, num, int, double, String, Function, Dynamic. 1223 // any of bool, num, int, double, String, Function, Dynamic.
1224 // The exception is signature classes, which are compiler generated and 1224 // The exception is signature classes, which are compiler generated and
1225 // represent a function type, therefore implementing the Function interface. 1225 // represent a function type, therefore implementing the Function interface.
1226 if (!cls_belongs_to_core_lib) { 1226 if (!cls_belongs_to_core_lib) {
1227 if (interface.IsBoolInterface() || 1227 if (interface.IsBoolType() ||
1228 interface.IsNumberType() || 1228 interface.IsNumberType() ||
1229 interface.IsIntInterface() || 1229 interface.IsIntInterface() ||
1230 interface.IsDoubleInterface() || 1230 interface.IsDoubleInterface() ||
1231 interface.IsStringInterface() || 1231 interface.IsStringInterface() ||
1232 (interface.IsFunctionType() && !cls.IsSignatureClass()) || 1232 (interface.IsFunctionType() && !cls.IsSignatureClass()) ||
1233 interface.IsDynamicType()) { 1233 interface.IsDynamicType()) {
1234 const Script& script = Script::Handle(cls.script()); 1234 const Script& script = Script::Handle(cls.script());
1235 ReportError(script, cls.token_pos(), 1235 ReportError(script, cls.token_pos(),
1236 "'%s' is not allowed to extend or implement '%s'", 1236 "'%s' is not allowed to extend or implement '%s'",
1237 String::Handle(cls.Name()).ToCString(), 1237 String::Handle(cls.Name()).ToCString(),
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 void ClassFinalizer::ReportError(const char* format, ...) { 1392 void ClassFinalizer::ReportError(const char* format, ...) {
1393 va_list args; 1393 va_list args;
1394 va_start(args, format); 1394 va_start(args, format);
1395 const Error& error = Error::Handle( 1395 const Error& error = Error::Handle(
1396 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); 1396 Parser::FormatError(Script::Handle(), -1, "Error", format, args));
1397 va_end(args); 1397 va_end(args);
1398 ReportError(error); 1398 ReportError(error);
1399 } 1399 }
1400 1400
1401 } // namespace dart 1401 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/lib_impl_sources.gypi ('k') | runtime/vm/code_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698