HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.19k stars 655 forks source link

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

Open RblSb opened 2 months ago

RblSb commented 2 months ago

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;
    }
}

https://github.com/HaxeFoundation/haxe/blob/3b050f0a108d47c71622a70e330ad38c1ef43d15/src/typing/typeloadFields.ml#L1021-L1028

Simn commented 1 month ago

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 commented 1 month ago

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