Created
June 14, 2016 19:09
-
-
Save francescoagati/7db8f5a4216c4f6c1f0c3f93433e4810 to your computer and use it in GitHub Desktop.
haxe nested structInit
This file contains 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
@:structInit | |
class A { | |
var x:Int; | |
var y:Int; | |
} | |
@:structInit | |
class B { | |
var a:A; | |
var k:Int; | |
} | |
class Main { | |
static function main() { | |
var b:B = {a:{x:1,y:2},k:3}; | |
} | |
} |
This file contains 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
// Generated by Haxe 3.3.0 | |
(function () { "use strict"; | |
var A = function(x,y) { | |
this.x = x; | |
this.y = y; | |
}; | |
var B = function(a,k) { | |
this.a = a; | |
this.k = k; | |
}; | |
var Main = function() { }; | |
Main.main = function() { | |
new B(new A(1,2),3); | |
}; | |
Main.main(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment