Fixed (Unreleased)

AOTPrebuild class naming error when identifier starts with underscore

RxMarcus 8 months ago updated by Lazlo Bonin (Lead Developer) 6 months ago 3

After running my AOTPrebuild, I get a ton of errors saying: Assets\Ludiq\Ludiq.Core\Generated\AotStubs.cs(3462,22): error CS1519: Invalid token '2D' in class, struct, or interface member declaration

Here is just 1 example of the error methods referenced in AotStubs.cs:

// _2DxFX.op_Equality


public static void 2DxFX_op_Equality()


global::UnityEngine.Object arg0 = default(global::UnityEngine.Object);

global::UnityEngine.Object arg1 = default(global::UnityEngine.Object);

bool @operator = (arg0 == arg1);

global::Ludiq.StaticFunctionInvoker optimized = new global::Ludiq.StaticFunctionInvoker(default(global::System.Reflection.MethodInfo));

optimized.Invoke(null, arg0, arg1);



I am able to "fix" the issue by manually going through each of these methods and adding a '_' to the start of the method name, but I'm not certain that's the correct thing to do anyway.

Bolt Version:
Unity Version:
Xbox One
Scripting Backend:
.NET Version (API Compatibility Level):
.NET Standard 2.0
Working on Fix

Hi RxMarcus,

Sorry you're experiencing this issue and thanks for the report.

It seems like our identifier generation code is not handling types that start with numbers properly. I'm curious though, where is the 2DxFX type coming from? Usually C# doesn't let you compile types that start with numbers in the first place.

I'll backport some code generation fixes from Bolt 2 to fix that case, but really I'd be curious to know how it got to happen in the first place!

Hey Lazlo,
It appears that they put a '_' before each class. Here is a sample of the classes from the package:

Hope that is helpful!

Fixed (Unreleased)

Hi RxMarcus,

Thanks for the report and sorry for the late reply. This will be fixed in the next version of Bolt 1.