forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request godotengine#88371 from raulsntos/dotnet/generics-ii
C#: Various fixes to generic scripts
- Loading branch information
Showing
12 changed files
with
126 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/Generic1T.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma warning disable CS0169 | ||
|
||
namespace Godot.SourceGenerators.Sample | ||
{ | ||
partial class Generic1T<T> : GodotObject | ||
{ | ||
private int _field; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/Generic2T.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#pragma warning disable CS0169 | ||
|
||
namespace Godot.SourceGenerators.Sample | ||
{ | ||
// Generic again but different generic parameters | ||
partial class Generic2T<T, R> : GodotObject | ||
{ | ||
private int _field; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...edSources/Generic_ScriptPath.generated.cs → ...ces/Generic(Of T)_ScriptPath.generated.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
using Godot; | ||
[ScriptPathAttribute("res://Generic.cs")] | ||
partial class Generic | ||
partial class Generic<T> | ||
{ | ||
} |
9 changes: 9 additions & 0 deletions
9
...rceGenerators.Tests/TestData/GeneratedSources/NamespaceA.SameName_ScriptPath.generated.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Godot; | ||
namespace NamespaceA { | ||
|
||
[ScriptPathAttribute("res://SameName.cs")] | ||
partial class SameName | ||
{ | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/Generic.GD0003.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Godot; | ||
|
||
partial class Generic<T> : GodotObject | ||
{ | ||
private int _field; | ||
} | ||
|
||
// Generic again but different generic parameters | ||
partial class {|GD0003:Generic|}<T, R> : GodotObject | ||
{ | ||
private int _field; | ||
} | ||
|
||
// Generic again but without generic parameters | ||
partial class {|GD0003:Generic|} : GodotObject | ||
{ | ||
private int _field; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/SameName.GD0003.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Godot; | ||
|
||
namespace NamespaceA | ||
{ | ||
partial class SameName : GodotObject | ||
{ | ||
private int _field; | ||
} | ||
} | ||
|
||
// SameName again but different namespace | ||
namespace NamespaceB | ||
{ | ||
partial class {|GD0003:SameName|} : GodotObject | ||
{ | ||
private int _field; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters