Created
October 21, 2010 12:47
-
-
Save Stray/638414 to your computer and use it in GitHub Desktop.
I had hoped that the compiler/AVM might be able to infer that the interface is valid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface ICompoundInterface extends IDrawable, IEdible | |
| { | |
| } | |
| public class SomethingConcrete implements IDrawable, IEdible | |
| { | |
| } | |
| // throws type conversion error | |
| var concreteThing:ICompoundInterface = ICompoundInterface(new SomethingConcrete()); | |
| // no error but concreteThing is null | |
| var concreteThing:ICompoundInterface = new SomethingConcrete() as ICompoundInterface; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment