Browse Source

Added DistanceToType() for TBoolType. Fixes #551.

Brucey 4 years ago
parent
commit
0f6b142ee9
1 changed files with 13 additions and 0 deletions
  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"