瀏覽代碼

Merge pull request #2295 from Rune-Magic/patch-1

Make NoDiscard work on all types
Brian Fiete 1 周之前
父節點
當前提交
17d612c314
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      BeefLibs/corlib/src/Attribute.bf

+ 1 - 1
BeefLibs/corlib/src/Attribute.bf

@@ -559,7 +559,7 @@ namespace System
 
 	/// If [NoDiscard] is used on a method, the the compiler will show a warning if the result is discarded.
 	/// If used on a type, the compiler will show an warning if any method returns that type and the caller discards the result.
-	[AttributeUsage(.Method | .Class | .Struct)]
+	[AttributeUsage(.Method | .Types)]
 	public struct NoDiscardAttribute : Attribute
 	{
 		public this()