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

オープン
#1,589 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp
領域
game-dev

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C++
スター
6.1k
フォーク
337
平均マージ
5日 8時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Redot-Engine/redot-engine のほかの issue

Redot-Engine/redot-engine の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。