Skip to content

Instantly share code, notes, and snippets.

@wolever
Created April 26, 2010 22:34
Show Gist options
  • Save wolever/380046 to your computer and use it in GitHub Desktop.
Save wolever/380046 to your computer and use it in GitHub Desktop.
// ActionScript is stupid. It's no secret. But, to maintain my own sanity, I need to rant about it… So I'll
// do that here.
// First, interfaces.
// I know, I know… It's not vert sporting to point out flaws in AS interfaces… But they consistently
// make me mad, so I'm going to do it anyway.
// First, type checking of the implementation.
// I think it's done by string comparison instead of, you know, the right way.
// Take this interface, for example:
interface Foo { function getFoo():Foo; }
// And then this implementation:
class SomeFoo implements Foo { public function getFoo():SomeFoo { ... }; }
// The 'getFoo' method returns an instance of 'Foo' (which also happens to be a 'SomeFoo'),
// so the interface contract is fulfilled and everything is happy. Right?
// Ha! Nope. As far as ActionScript is concerned, 'SomeFoo.getFoo' has an invalid type signature.
// Oh, wait, and they have known about this… For 3 years: http://bugs.adobe.com/jira/browse/ASC-2585
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment