瀏覽代碼

Rando fix

Brian Fiete 5 年之前
父節點
當前提交
59233cc996
共有 2 個文件被更改,包括 13 次插入2 次删除
  1. 6 0
      IDE/mintest/minlib/src/System/Attribute.bf
  2. 7 2
      IDE/mintest/minlib/src/System/Object.bf

+ 6 - 0
IDE/mintest/minlib/src/System/Attribute.bf

@@ -346,6 +346,12 @@ namespace System
 		}
 	}
 
+	[AttributeUsage(.Method)]
+	public struct CommutableAttribute : Attribute
+	{
+
+	}
+
 	[AttributeUsage(.Method | .Constructor)]
 	public struct ErrorAttribute : Attribute
 	{

+ 7 - 2
IDE/mintest/minlib/src/System/Object.bf

@@ -176,7 +176,7 @@ namespace System
 
 		public int GetHashCode()
 		{
-			return (int)mVal;
+			return (int)(void*)mVal;
 		}
 	}
 
@@ -377,7 +377,7 @@ namespace System
 		}
     }
 
-    struct Int : int, IOpComparable, IOpAddable, IIsNaN
+    struct Int : int, IOpComparable, IOpAddable, IOpDividable, IIsNaN
     {
 		public static int operator<=>(Int a, Int b)
 		{
@@ -389,6 +389,11 @@ namespace System
 			return (int)a + (int)b;
 		}
 
+		public static Self operator/(Self a, Self b)
+		{
+			return (int)a / (int)b;
+		}
+
 		bool IIsNaN.IsNaN
 		{
 			[SkipCall]