Skip to content

Instantly share code, notes, and snippets.

@y-yu
Created November 23, 2014 15:26
Show Gist options
  • Save y-yu/2ad43c0e6089632c8458 to your computer and use it in GitHub Desktop.
Save y-yu/2ad43c0e6089632c8458 to your computer and use it in GitHub Desktop.
class AliceFactory2 implements PersonInterface<Alice> {
public function new() { }
public function make() : AbsPerson<Alice> {
return Alice.AliceConst;
}
}
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