New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bindings generator] generates invalid code on c# side #2582
Comments
The following compiles just fine, are you missing API_CLASS() class GAME_API Item : public Script
{
API_AUTO_SERIALIZATION();
DECLARE_SCRIPTING_TYPE(Item);
API_STRUCT() struct GAME_API Attribute
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Attribute);
};
// [Script]
void OnEnable() override;
void OnDisable() override;
void OnUpdate() override;
};
API_STRUCT() struct GAME_API RuntimeItem
{
DECLARE_SCRIPTING_TYPE_MINIMAL(RuntimeItem);
API_FIELD() Array<Item::Attribute> Attributes;
}; |
I have it in the source but i striped from ishue for redability [Edit] DECLARE_SCRIPTING_TYPE_MINIMAL is incorect for struct btw Compiler on c# is yeling abaut this |
I think, for structs you should use |
found the place for a patch
|
The final code that reproduces the issue: API_CLASS() class GAME_API Item : public Script
{
API_AUTO_SERIALIZATION();
DECLARE_SCRIPTING_TYPE(Item);
API_STRUCT() struct GAME_API Attribute
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Attribute);
API_FIELD() String foo;
};
// [Script]
void OnEnable() override;
void OnDisable() override;
void OnUpdate() override;
};
API_STRUCT() struct GAME_API RuntimeItem
{
DECLARE_SCRIPTING_TYPE_MINIMAL(RuntimeItem);
API_FIELD() Array<Item::Attribute> Attributes;
}; |
Issue description:
error CS0426: The type name 'Item' does not exist in the type 'Item.AttributeMarshaller'
error CS0411: The type arguments for method 'NativeInterop.ConvertArray<TSrc, TDst>(Span, Func<TSrc, TDst>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
Steps to reproduce:
compile
get the errors
[edit]
genereted ouput
The text was updated successfully, but these errors were encountered: