Chromium Code Reviews| Index: runtime/vm/class_finalizer.cc |
| =================================================================== |
| --- runtime/vm/class_finalizer.cc (revision 25920) |
| +++ runtime/vm/class_finalizer.cc (working copy) |
| @@ -1528,9 +1528,6 @@ |
| name.ToCString()); |
| } |
| cls.set_is_type_finalized(); |
| - // Signature classes extend Object. No need to add this class to the direct |
| - // subclasses of Object. |
| - ASSERT(super_type.IsNull() || super_type.IsObjectType()); |
|
Florian Schneider
2013/08/12 18:03:06
Do we rely on this assertion somewhere else?
|
| // The type parameters of signature classes may have bounds. |
| FinalizeUpperBounds(cls); |
| @@ -1880,10 +1877,14 @@ |
| CLASS_LIST_TYPED_DATA(DO_NOT_EXTEND_TYPED_DATA_CLASSES) |
| #undef DO_NOT_EXTEND_TYPED_DATA_CLASSES |
| case kByteDataViewCid: |
| - case kDartFunctionCid: |
| case kWeakPropertyCid: |
| is_error = true; |
| break; |
| + case kDartFunctionCid: |
| + // Signature classes, which are compiler generated and represent a |
|
Ivan Posva
2013/08/13 07:35:09
I don't think this is a valid restriction.
Florian Schneider
2013/08/13 14:52:20
Done.
|
| + // function type, are allowed to extend the Function class. |
| + if (!cls.IsSignatureClass()) is_error = true; |
| + break; |
| default: { |
| // Special case: classes for which we don't have a known class id. |
| if (super_type.IsDoubleType() || |
| @@ -1935,7 +1936,7 @@ |
| interface.IsIntType() || |
| interface.IsDoubleType() || |
| interface.IsStringType() || |
| - (interface.IsFunctionType() && !cls.IsSignatureClass()) || |
| + interface.IsFunctionType() || |
| interface.IsDynamicType()) { |
| const Script& script = Script::Handle(cls.script()); |
| ReportError(script, cls.token_pos(), |