Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support accessing static trait members and methods from outside #135

Closed
roberthusak opened this issue Dec 30, 2017 · 3 comments
Closed

Support accessing static trait members and methods from outside #135

roberthusak opened this issue Dec 30, 2017 · 3 comments
Assignees
Labels
Projects

Comments

@roberthusak
Copy link
Contributor

Test case:

<?php
trait T {
  public static function foo() {
    echo "foo";
  }
  public static $bar = "bar";
}
T::foo();
echo T::$bar;

Expected result: foobar

Actual result: Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) - this is probably caused by the unfilled type parameter T0, because T::foo() is compiled as T<T0>.foo(ctx)

@roberthusak roberthusak added this to TODO in MediaWiki via automation Dec 30, 2017
@jakubmisek
Copy link
Member

Nice test case, I wouldn't ever believe PHP allows using members of a trait directly.

Yes, implicit type parameter TSelf is not specified.

jakubmisek added a commit that referenced this issue Dec 31, 2017
- #135
- optimizes resolution of type eq to current class scope (avoids
ambiguities and runtime resolution)
- better type resolution (avoids ambiguities if possible)
- ready for generic arguments
- resolves trait type correctly
@roberthusak
Copy link
Contributor Author

Thanks, well, I was surprised, too..

@jakubmisek
Copy link
Member

more or less fixed in recent commits, still not handled in runtime binders

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
MediaWiki
  
Done
Development

No branches or pull requests

2 participants