浏览代码

Added DistanceToType() for TBoolType. Fixes #551.

Brucey 4 年之前
父节点
当前提交
0f6b142ee9
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      type.bmx

+ 13 - 0
type.bmx

@@ -412,6 +412,19 @@ Type TBoolType Extends TType
 	Method WidensToType:Int( ty:TType )
 		Return IsNumericType(ty)
 	End Method
+
+	Method DistanceToType:Int(ty:TType)
+
+		If TBoolType(ty)<>Null Then
+			Return 0
+		End If
+		
+		If TIntType(ty)<>Null Then
+			Return 1
+		End If
+		
+		Return 4
+	End Method
 	
 	Method ToString$()
 		Return "Bool"