# Issue with Haxe Macro Library - Type Name Error in Expr.hx

**URL:** <https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089>\
**Category:** Haxe\
**Tags:** macro, std\
**Created:** [November 22, 2023, 3:44pm UTC](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089 "2023-11-22T15:44:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragsbruh](https://community.haxe.org/user_avatar/community.haxe.org/dragsbruh/32/2250_2.png) [@dragsbruh](https://community.haxe.org/u/dragsbruh)\
**Post date:** [November 22, 2023, 3:44pm UTC](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089/1 "2023-11-22T15:44:37Z")

</div>

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.”

```haxe
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:

```haxe
/**

Represents a function in the AST.

**/
typedef wFunction { // and so on

```

**Code used:**

```haxe
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:**

1. Updated Haxe (haxelib upgrade stuff) to the latest version.
2. 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.

```haxe
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:**

```haxe
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

```

---

<div class="post-metadata">

**Author:** ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)\
**Post date:** [November 22, 2023, 3:50pm UTC](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089/2 "2023-11-22T15:50:19Z")

</div>

According to github that line hasn’t been modified for at least 10 years, and is correctly written `typedef Function` in the latest release.

You might have accidentally modified your file. Try with removing the `w`.

---

<div class="post-metadata">

**Author:** ![dragsbruh](https://community.haxe.org/user_avatar/community.haxe.org/dragsbruh/32/2250_2.png) [@dragsbruh](https://community.haxe.org/u/dragsbruh)\
**Post date:** [November 22, 2023, 3:52pm UTC](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089/3 "2023-11-22T15:52:31Z")

</div>

My bad. Thanks! That was kind of embarrasing but whaatever. But that brings up the question… doesnt haxelib selfupdate (or haxelib install haxelib i tried both) replace code files with fresh files? I dont remember opening Expr.hx but it might be my mistake so yeah.

---

<div class="post-metadata">

**Author:** ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)\
**Post date:** [November 22, 2023, 3:54pm UTC](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089/4 "2023-11-22T15:54:20Z")

</div>

`haxelib selfupdate` updates haxelib itself, to update haxe you’ll have to do it manually.

---

<div class="post-metadata">

**Author:** ![dragsbruh](https://community.haxe.org/user_avatar/community.haxe.org/dragsbruh/32/2250_2.png) [@dragsbruh](https://community.haxe.org/u/dragsbruh)\
**Post date:** [November 22, 2023, 3:54pm UTC](https://community.haxe.org/t/issue-with-haxe-macro-library-type-name-error-in-expr-hx/4089/5 "2023-11-22T15:54:43Z")

</div>

Oh, thanks! This has saved my life
