C#] [Export] does not support struct types (GD0102), inconsistent with GDScript struct support

Abierto
#1,589 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp
Área
game-dev

Línea de trabajo

Start by tracing the GD0102 diagnostic for exported C# members and the export type validation path; the issue names no source files or tests. Check how GDScript struct support is represented and compare it with C#/Mono exports. Done means either C# struct fields can be exported with suitable coverage, or the limitation is documented clearly.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement topic:dotnet usability
Tested versions

Latest Redot stable build.

System information

Window 11

Issue description

GDScript has support for struct types, but the equivalent C#/Mono side does not — marking a C# struct field with [Export] fails to compile with GD0102. This is inconsistent: both GDScript and C# are first-class scripting languages in Redot, but only one of them can use structs as an exportable grouping of related fields.

Expected: a C# struct should be exportable via [Export], consistent with GDScript's struct support — or, if this is intentionally unsupported, it should be documented clearly as a known C#/Mono limitation rather than failing with a generic "type not supported" diagnostic.

Actual: the project fails to build entirely, and they say that struct are not supported.

Steps to reproduce

Create a C# script with a [Export] field typed as a custom struct.
Attempt to build the project.
Build fails with GD0102.
Minimal reproduction code:


public partial class Test : Node
{
    [Export] Stats stats;
}

public partial struct Stats
{
    public int health;
    public int maxHealth;
    public int level;
    public int maxLevel;
}

Error output:

GD0102: The type of the exported member 'Test.stats' is not supported

Minimal reproduction project (MRP)

Not needed just create a new mono project and export the C# struct as a member it will throw an error.

Lenguaje dominante
C++
Estrellas
6.1k
Forks
337
Merge medio
5 d 8 h
PR fusionados (30 d)
13

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Redot-Engine/redot-engine

Todos los issues de Redot-Engine/redot-engine

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.