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

[eval/lua] Reflect.hasField on function reference throws exception #10993

Closed
sebthom opened this issue Mar 1, 2023 · 3 comments
Closed

[eval/lua] Reflect.hasField on function reference throws exception #10993

sebthom opened this issue Mar 1, 2023 · 3 comments

Comments

@sebthom
Copy link
Contributor

sebthom commented Mar 1, 2023

The following code works on all targets except interp/eval and lua.

class Test {
  static function foo() {
  }
  static function main() {
    trace(Reflect.hasField(foo, "bar")); // should print `false`
  }
}

Eval: Uncaught exception Unexpected value VFunction(#fun), expected object
Lua: attempt to index upvalue 'o' (a function value)

@Simn
Copy link
Member

Simn commented Mar 1, 2023

This is kind of covered by the "This is only guaranteed to work for anonymous structures." line in its documentation, but if you look into lua then I'm happy to also fix eval and make this consistent.

@sebthom
Copy link
Contributor Author

sebthom commented Mar 1, 2023

I submitted PR #10994
It also includes a test case. The test is currently disabled for eval (until you had the chance to fix eval).

@sebthom
Copy link
Contributor Author

sebthom commented Mar 4, 2023

@Simn thanks!

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

No branches or pull requests

2 participants