Created
December 5, 2014 04:17
-
-
Save natemort/cf769a81fbb28d0dd30d to your computer and use it in GitHub Desktop.
What should the value of someVariable be? Is it valid to initialize fields in an interface? Javascript says it's valid, and that the value should be 3. However, if someVariable isn't initialized in TestImplementation, the field gets stripped out and the generated javascript will result in an error. C# code is generated, but fails to compile, sta…
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
| class Test { | |
| static function main() { | |
| var test = new TestImplementation(); | |
| trace(test.someVariable + ""); | |
| } | |
| } | |
| interface TestInterface { | |
| public var someVariable:Int = 2; | |
| } | |
| class TestImplementation implements TestInterface { | |
| public var someVariable:Int = 3; | |
| public function new() { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment