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

Macro using method not found #10587

Closed
filt3rek opened this issue Feb 8, 2022 · 2 comments
Closed

Macro using method not found #10587

filt3rek opened this issue Feb 8, 2022 · 2 comments
Assignees

Comments

@filt3rek
Copy link
Contributor

filt3rek commented Feb 8, 2022

Hej,

Strange error here : https://try.haxe.org/#fFB78764 Method foo not found on class Macro
Same if usingcommented and Macro.foo( 1 ); uncommented.
Without using, it throw correct error Type not found : Expr
Test.hx :

using Macro;
class Test {
  static function main() {
    1.foo();
    //Macro.foo( 1 );
  }
}

Macro.hx :

class Macro {
  public static macro function foo( e : Expr ){

  }
}
@Simn Simn self-assigned this Feb 22, 2022
@Simn
Copy link
Member

Simn commented Feb 22, 2022

The original example could mean that the error is somehow swallowed while trying to resolve the static extension, but what's strange is that this also fails:

using Macro;

class Main {
	static function main() {
		Macro.foo( 1 );
	}
}

I don't think the using Macro here should even do anything, because the field can be resolved before we even have to look at static extensions. I think that's a separate issue, but also one we should look into.

@filt3rek
Copy link
Contributor Author

Hej Simn !
Thanks for your reply.
And yes you're right this, with a simple import also fails so probably nothing to do with static extension.

import Macro;
class Test {
  static function main() {
    Macro.foo( 1 );
  }
}

@Simn Simn closed this as completed in 71db0d8 Feb 22, 2022
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