Browse Source

Merge pull request #71988 from raulsntos/🦭-attributes

Seal C# attributes
Rémi Verschelde 2 years ago
parent
commit
fdd02b8827

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/AssemblyHasScriptsAttribute.cs

@@ -10,7 +10,7 @@ namespace Godot
     /// collection of types that implement scripts; otherwise, retrieving the types requires lookup.
     /// </summary>
     [AttributeUsage(AttributeTargets.Assembly)]
-    public class AssemblyHasScriptsAttribute : Attribute
+    public sealed class AssemblyHasScriptsAttribute : Attribute
     {
         /// <summary>
         /// If the Godot scripts contained in the assembly require lookup

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/MustBeVariantAttribute.cs

@@ -7,5 +7,5 @@ namespace Godot
     /// that can be marshaled from/to a <see cref="Variant"/>.
     /// </summary>
     [AttributeUsage(AttributeTargets.GenericParameter)]
-    public class MustBeVariantAttribute : Attribute { }
+    public sealed class MustBeVariantAttribute : Attribute { }
 }

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttribute.cs

@@ -9,7 +9,7 @@ namespace Godot
     /// By default, methods are not exposed to networking (and RPCs).
     /// </summary>
     [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
-    public class RPCAttribute : Attribute
+    public sealed class RPCAttribute : Attribute
     {
         /// <summary>
         /// RPC mode for the annotated method.

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ScriptPathAttribute.cs

@@ -6,7 +6,7 @@ namespace Godot
     /// An attribute that contains the path to the object's script.
     /// </summary>
     [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
-    public class ScriptPathAttribute : Attribute
+    public sealed class ScriptPathAttribute : Attribute
     {
         /// <summary>
         /// File path to the script.

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/SignalAttribute.cs

@@ -3,5 +3,5 @@ using System;
 namespace Godot
 {
     [AttributeUsage(AttributeTargets.Delegate)]
-    public class SignalAttribute : Attribute { }
+    public sealed class SignalAttribute : Attribute { }
 }

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ToolAttribute.cs

@@ -3,5 +3,5 @@ using System;
 namespace Godot
 {
     [AttributeUsage(AttributeTargets.Class)]
-    public class ToolAttribute : Attribute { }
+    public sealed class ToolAttribute : Attribute { }
 }