SHOW:
|
|
- or go back to the newest paste.
| 1 | class Main extends flash.display.Sprite | |
| 2 | {
| |
| 3 | public var i:Int; | |
| 4 | - | static function test(?i:Int) return i |
| 4 | + | |
| 5 | - | public function new(?i:Int) |
| 5 | + | public function new(?i:Null<Int>) |
| 6 | {
| |
| 7 | super(); | |
| 8 | this.i = i; | |
| 9 | } | |
| 10 | ||
| 11 | public static function main() | |
| 12 | {
| |
| 13 | - | trace(test());//null |
| 13 | + | trace(new Main(null).i);//0 |
| 14 | - | trace(new Main().i);//0 |
| 14 | + | |
| 15 | } |