When using the 'Class' datatype, how can I specify the type so I only accept subclass of a specific class?
问题 I've got a method that accepts a parameter of type Class , and I want to only accept classes that extend SuperClass . Right now, all I can figure out to do is this, which does a run-time check on an instance: public function careless(SomeClass:Class):void { var instance:SomeClass = new SomeClass(); if (instance as SuperClass) { // great, i guess } else { // damn, wish i'd have known this at compile time } } Is there any way to do something like this, so I can be assured that a Class instance