Created
November 23, 2014 15:26
-
-
Save y-yu/2ad43c0e6089632c8458 to your computer and use it in GitHub Desktop.
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
class AliceFactory2 implements PersonInterface<Alice> { | |
public function new() { } | |
public function make() : AbsPerson<Alice> { | |
return Alice.AliceConst; | |
} | |
} |
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
class Test { | |
static function test<T>(m : PersonInterface<T>) : T { | |
return m.make(); | |
} | |
static function main() { | |
var x = test(new AliceFactory2()); | |
$type(x); | |
trace(x); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment