haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Hover over macro cause compiler failure with `disable-hxb-cache`

Open RblSb opened this issue 2 months ago • 1 comments

Found it while trying to reproduce another failure and tested if -D disable-hxb-cache will help...

@:build(MyMacro.build()) // hover over `MyMacro`
class Main { // and then over `Main`
	static function main() {
		trace("Hello, world!");
	}
}


import haxe.macro.Context;
import haxe.macro.Expr;

class MyMacro {
	macro static public function build():Array<Field> {
		final fields = Context.getBuildFields();
		return fields;
	}
}

Project: ahovermacro.zip

[Error - 19:31:03] Request textDocument/hover failed.
  Message: Error: Compiler failure: Could not find dependency MyMacro of Main in the cache
Please submit an issue at https://github.com/HaxeFoundation/haxe/issues/new
Attach the following information:
Haxe: 5.0.0-preview.1+d73bdfa26; OS type: unix;
File "src/compiler/server.ml", line 323, characters 117-124
Called from Server.check_module.check.check_dependencies.(fun) in file "src/compiler/server.ml", line 323, characters 5-124
Called from PMap.iter.loop in file "src/pMap.ml", line 132, characters 38-43
Called from Server.check_module.check.check_dependencies in file "src/compiler/server.ml", lines 317-328, characters 3-19
Called from Server.check_module in file "src/compiler/server.ml", line 374, characters 13-33
Called from Std.finally in file "src/std.ml", line 24, characters 6-9
Called from Server.type_module in file "src/compiler/server.ml", line 565, characters 15-50
Called from DisplayTexpr.check_display_file in file "src/context/display/displayTexpr.ml", line 177, characters 16-87
Called from Compiler.do_type.(fun) in file "src/compiler/compiler.ml", line 315, characters 42-81
Called from Compiler.do_type in file "src/compiler/compiler.ml", lines 314-321, characters 2-3
Called from Std.finally in file "src/std.ml", line 24, characters 6-9
Called from Timer.time in file "src/core/timer.ml" (inlined), line 72, characters 1-24
Called from Compiler.compile in file "src/compiler/compiler.ml", line 391, characters 37-118
Called from Compiler.compile_safe in file "src/compiler/compiler.ml", line 437, characters 1-5
Called from Compiler.compile_safe in file "src/compiler/compiler.ml", line 483, characters 5-23
Called from Compiler.compile_ctx.run in file "src/compiler/compiler.ml", lines 525-529, characters 2-3
Called from Compiler.catch_completion_and_exit in file "src/compiler/compiler.ml", line 497, characters 2-9
Called from Compiler.HighLevel.entry.loop in file "src/compiler/compiler.ml", line 738, characters 5-43
Called from Compiler.HighLevel.entry in file "src/compiler/compiler.ml", line 750, characters 13-22
Called from Server.process in file "src/compiler/server.ml", line 798, characters 1-39
Called from Server.wait_loop in file "src/compiler/server.ml", line 839, characters 3-30
Called from Compiler.HighLevel.entry.loop in file "src/compiler/compiler.ml", line 738, characters 5-43

  Code: -32603 

RblSb avatar Oct 06 '25 16:10 RblSb

Same project has broken new | completion if you call it after trace line. Typing trace(new |) will also generate error:

Request textDocument/signatureHelp failed.
  Message: Invalid_argument("Empty module name is not allowed")

RblSb avatar Oct 06 '25 17:10 RblSb