-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Hi @joshtynjala,
I just noticed that the compiler is not performing type checks for super calls in constructors.
Having this would prevent runtime errors by detecting issues at compilation time.
The following code compiles fine but fails at runtime:
package
{
public class SuperTypeCheckTest
{
public function SuperTypeCheckTest()
{
new B();
}
}
}
import flash.geom.Point;
class A
{
public function A(point:Point)
{
}
}
class B extends A
{
public function B()
{
super(42); // TypeError: Error #1034: Type Coercion failed: cannot convert 42 to flash.geom.Point.
}
}Best,
Aurélien
Reactions are currently unavailable