THIS IS A MISTAKE ISSUE RESOLVED PLEASE GO BACK
I’m currently an issue which is apparently with the Haxe macro library, in Expr.hx
(C:\HaxeToolkit\haxe\std/haxe/macro/Expr.hx:720). The error message is indicating that “Type name should start with an uppercase letter.”
C:\HaxeToolkit\haxe\std/haxe/macro/Expr.hx:720: characters 9-18 : Type name should start with an uppercase letter
This is the code that I found in line 720:
/**
Represents a function in the AST.
**/
typedef wFunction { // and so on
Code used:
using haxe.macro.Context;
enum Output {
Text(data:String);
Media(name:String, data:String);
}
typedef OutFunction = Output->Void;
class Commands {
public static var out:OutFunction;
public static function init(outFun:OutFunction) {
Commands.out = outFun;
}
public static macro function discover() {
var commands = Context.getBuildFields(Context.getLocalModule(), "commands");
return {
expr: macro for (cmd in commands) {
$v{cmd}.Command.init();
}
};
}
}
The error is apparently in the Haxe macro library and is related to type names starting with a lowercase letter. I’ve already updated my Haxe installation to the latest version, but the problem does not go away.
Steps Taken:
- Updated Haxe (haxelib upgrade stuff) to the latest version.
- Checked my code for proper naming conventions (all type names start with an uppercase letter).
More info:
I tried neko, hashlink and interp targets even though I think the issue is not in compiler targets.
This might be an issue specific to me but yeah, I need help.
Minimum reproducible example:
I tried my best to make this example.
using haxe.macro.Context;
using haxe.macro.Expr;
class Main {
static function main() {
test();
}
macro static function test() {
return {
expr: macro for (cmd in commands) {
trace("Pls help");
}
};
}
}
Output:
PS C:\Users\<no>\Documents\projects\others\haxe issue expr std> haxe --main Main
C:\HaxeToolkit\haxe\std/haxe/macro/Expr.hx:720: characters 9-18 : Type name should start with an uppercase letter