You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fully qualify C# default values in exported fields.
This avoids issues when the default values rely on using namespaces.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
#pragma warning disable CS0169
|
||||
@@ -83,6 +84,10 @@ namespace Godot.SourceGenerators.Sample
|
||||
[Export] private StringName[] field_StringNameArray = { "foo", "bar" };
|
||||
[Export] private NodePath[] field_NodePathArray = { "foo", "bar" };
|
||||
[Export] private RID[] field_RIDArray = { default, default, default };
|
||||
// Note we use Array and not System.Array. This tests the generated namespace qualification.
|
||||
[Export] private Int32[] field_empty_Int32Array = Array.Empty<Int32>();
|
||||
// Note we use List and not System.Collections.Generic.
|
||||
[Export] private int[] field_array_from_list = new List<int>(Array.Empty<int>()).ToArray();
|
||||
|
||||
// Variant
|
||||
[Export] private Variant field_Variant = "foo";
|
||||
|
||||
Reference in New Issue
Block a user