mirror of
https://github.com/godotengine/godot.git
synced 2025-11-03 15:11:19 +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:
parent
c17f17eb98
commit
6ab93bd919
4 changed files with 83 additions and 2 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue