Skip to content

Instantly share code, notes, and snippets.

@frabbit
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frabbit/7d5c7af1707625eecb28 to your computer and use it in GitHub Desktop.
Save frabbit/7d5c7af1707625eecb28 to your computer and use it in GitHub Desktop.
Inlining could be done twice
class A implements B {
public function new () {}
public inline function plus (a:Int,b:Int):Int {
return a + b;
}
}
interface B {
public function plus (a:Int,b:Int):Int;
}
class Test {
public inline static function plusFoo (x:B) {
return x.plus(1,1);
}
public static function main () {
var a = new A();
plusFoo(a);
// results in a.plus(1,1), but after inlining param x of type B is known as type A where plus is inline
// so it would be possible to further inline the result to 1 + 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment