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

Hover error: Multiple resolve-read methods are not supported #11757

Open
RblSb opened this issue Sep 3, 2024 · 2 comments
Open

Hover error: Multiple resolve-read methods are not supported #11757

RblSb opened this issue Sep 3, 2024 · 2 comments

Comments

@RblSb
Copy link
Member

RblSb commented Sep 3, 2024

Hover over get and set shows errors in output:

abstract State({}) from {} {
	public function new() {
		this = {};
	}

	@:op(a.b) function get(key:String):Any {
		return key;
	}

	@:op(a.b) function set(key:String, value:Any):Any {
		return "set" + key;
	}
}

| TFun((_,_,t1) :: (_,_,t2) :: args,_) when is_empty_or_pos_infos args ->
if a.a_read <> None then raise_typing_error "Multiple resolve-read methods are not supported" cf.cf_pos;
check_fun t1 t2;
a.a_read <- Some cf;
| TFun((_,_,t1) :: (_,_,t2) :: (_,_,t3) :: args,_) when is_empty_or_pos_infos args ->
if a.a_write <> None then raise_typing_error "Multiple resolve-write methods are not supported" cf.cf_pos;
check_fun t1 t2;
a.a_write <- Some cf;

@Simn
Copy link
Member

Simn commented Oct 16, 2024

I'm not seeing that in vscode output:

Processing Arguments [--cwd,c:/git/haxerepro,-D,display-details,--no-output,--times,-D,macro-times,build.hxml,--interp,--display,{"jsonrpc":"2.0","id":41,"method":"display/hover","params":{"file":"c:/git/haxerepro/source/Main.hx","contents":"package;\n\nabstract State({}) from {} {\n\tpublic function new() {\n\t\tthis = {};\n\t}\n\n\t@:op(a.b) function get(key:String):Any {\n\t\treturn key;\n\t}\n\n\t@:op(a.b) function set(key:String, value:Any):Any {\n\t\treturn \"set\" + key;\n\t}\n}\n\nclass Main {\n\tpublic static function main():Void {}\n}\n","offset":161}}]
Defines analyzer_optimize=1,dce=full,display=1,display_details=1,dump=1,dump_ignore_var_ids=1,eval=1,haxe=5.0.0-alpha.1,haxe3=1,haxe4=1,haxe5=1,haxe_ver=5.000,hl_check=1,hl_ver=1.13.0,interp=1,js_es=5,macro_times=1,source_header=Generated by Haxe 5.0.0-alpha.1+a3c28e842,sys=1,target.name=eval,target.sys=1,target.threaded=1,target.unicode=1,true=1
Using signature 94623258c58c3520cf0618d92cbaae1d
Display position: c:\git\haxerepro\source\Main.hx: 161-161
compiler stage: CInitialized
compiler stage: CInitMacrosStart
compiler stage: CInitMacrosDone
 4,evl: parsed c:\git\haxerepro\source\Main.hx (not cached, is display file)
Stats = 1 files, 15 classes, 1 methods, 0 macros
Time spent : 0.007s

Where exactly are you seeing this?

@RblSb
Copy link
Member Author

RblSb commented Oct 16, 2024

Init basic Haxe project, add this abstract in Main file and hover over function get to get such error in haxe output panel:

[Error - 14:55:16] Request textDocument/hover failed.
  Message: Multiple resolve-read methods are not supported
  Code: -32603 

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