cretz / pratphall

A typed language targeting PHP (abandoned)
http://cretz.github.io/pratphall/
Other
45 stars 5 forks source link

Static function reference is not working properly #8

Closed cretz closed 11 years ago

cretz commented 11 years ago

This:

module Mod {
  export class Clas {
    static func() {
    }
  }
}
//fail
var f = Mod.Clas.func;
declare function some_function(val: any);
//fail
some_function(Mod.Clas.func);

Gives this:

namespace Mod {
    class Clas {
        public static function func() {
        }    
    }
}

namespace  {

    //fail
    $f = (new \ReflectionMethod(\Mod\Clas, 'func'))->getClosure(\Mod\Clas);
    //fail
    some_function(\Mod\Clas\func);
}
cretz commented 11 years ago

What a mess, how did I screw this up so badly?