You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using an interpolated string as the default value for an exported field or property can lead to ScriptPropertyDefValGenerator producing invalid C# code. The generator fully qualifying identifiers within the interpolated string, leading to the following error during compilation. This is due to the use of global:: within the interpolation string. Identifiers would need to be enclosed ().
CS0103: The name 'global' does not exist in the current context ..._ScriptPropertyDefVal.generated.cs(...)
partial class Foo
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(1);
- string __EngineVersion_default_value = $"{global::Godot.Engine.GetVersionInfo()}";+ string __EngineVersion_default_value = $"{(global::Godot.Engine.GetVersionInfo())}";
values.Add(PropertyName.EngineVersion, global::Godot.Variant.From<string>(__EngineVersion_default_value));
return values;
}
#endif // TOOLS#pragma warning restore CS0109
}
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered:
Tested versions
System information
Windows 10
Issue description
Using an interpolated string as the default value for an exported field or property can lead to
ScriptPropertyDefValGenerator
producing invalid C# code. The generator fully qualifying identifiers within the interpolated string, leading to the following error during compilation. This is due to the use ofglobal::
within the interpolation string. Identifiers would need to be enclosed()
.Steps to reproduce
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: