Last active
August 29, 2015 14:11
-
-
Save maxless/84ff869f40aea4d9dd8b to your computer and use it in GitHub Desktop.
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 | |
{ | |
public function new() | |
{} | |
public dynamic function test(): Dynamic | |
{ return null; } | |
public static function main() | |
{ | |
var t = new Test2(); | |
trace(t.test()); | |
var a: Dynamic = { a: 1, b: 2 }; | |
trace(a.a); | |
trace(Std.parseInt(a.a)); | |
trace(a.c); | |
trace(Std.parseInt(a.c)); | |
} | |
} | |
class Test2 extends Test | |
{ | |
public function test2(): Int | |
{ return 3; } | |
public override function test() | |
{ | |
var a: Dynamic = { b: 1 }; | |
var t = 1; | |
if (t == 1) | |
a = { c: test2() }; | |
return a; | |
} | |
function new() | |
{ super(); } | |
} |
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 | |
{ | |
public function new() | |
{} | |
public dynamic function test(): Dynamic | |
{ return null; } | |
public static function main() | |
{ | |
var str = 'a'; | |
var b: Bool = false; | |
var i = 1; | |
var f = 1.0; | |
var d: Dynamic = 1; | |
trace('d int:' + Std.is(d, Int)); | |
trace('d str:' + Std.is(d, String)); | |
trace('i int:' + Std.is(i, Int)); | |
trace('i float:' + Std.is(i, Float)); | |
trace('f int:' + Std.is(f, Int)); | |
trace('f float:' + Std.is(f, Float)); | |
trace(Std.is(str, String)); | |
trace(Std.is(b, Bool)); | |
trace(" str is a: " + Type.getClassName(Type.getClass(str))); | |
trace(" b is a: " + Type.getClassName(Type.getClass(b))); | |
trace('test!'); | |
} | |
} |
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
-main Test | |
-dce no | |
-neko test.n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment