Last active
August 29, 2015 14:13
-
-
Save frabbit/7d5c7af1707625eecb28 to your computer and use it in GitHub Desktop.
Inlining could be done twice
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 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