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

No hover/definition for overload call #11285

Closed
Tracked by #11583
RblSb opened this issue Jul 25, 2023 · 1 comment
Closed
Tracked by #11583

No hover/definition for overload call #11285

RblSb opened this issue Jul 25, 2023 · 1 comment

Comments

@RblSb
Copy link
Member

RblSb commented Jul 25, 2023

using Main.MathTools;

function main() {
	var float = 0.0;
	var int = 0;
	float.wrapAround(0, 1);
	int.wrapAround(0, 1); // no hover
}

class MathTools {
	extern overload public static inline function wrapAround(v:Int, min:Int, max:Int):Int {
		var range = max - min;
		return min + (((v - min) % range) + range) % range;
	}
	extern overload public static inline function wrapAround(v:Float, min:Float, max:Float):Float {
		var range = max - min;
		return min + (((v - min) % range) + range) % range;
	}
}
Request textDocument/hover failed.
  Message: Could not find a suitable overload, reasons follow

Also, if you swap functions in MathTools, then both calls will fail for hover.

@Simn
Copy link
Member

Simn commented Aug 31, 2023

From an initial investigation, the problem appears to be related to MCall. It holds the two actual call arguments, but the full call needs the initial self-argument as well in order to succeed, which means that all overload attempts fail with "not enough arguments".

I don't know yet why it works for Float version, I'd expect it to have the same behavior here. So there's likely another problem in play.

@Simn Simn closed this as completed in 2d05619 Aug 31, 2023
0b1kn00b pushed a commit to 0b1kn00b/haxe that referenced this issue Jan 25, 2024
@kLabz kLabz mentioned this issue Mar 4, 2024
19 tasks
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