Browse Source

Fixed issue using new types as var params.

Brucey 2 years ago
parent
commit
4c7ca3a804
2 changed files with 11 additions and 7 deletions
  1. 7 3
      expr.bmx
  2. 4 4
      type.bmx

+ 7 - 3
expr.bmx

@@ -1931,6 +1931,10 @@ Type TBinaryMathExpr Extends TBinaryExpr
 				exprType=New TLongType
 				exprType=New TLongType
 			Else If TULongType(lhs.exprType) Then
 			Else If TULongType(lhs.exprType) Then
 				exprType=New TULongType
 				exprType=New TULongType
+			Else If TLongIntType(lhs.exprType) Then
+				exprType=New TLongIntType
+			Else If TULongIntType(lhs.exprType) Then
+				exprType=New TULongIntType
 			Else If TSizeTType(lhs.exprType) Then
 			Else If TSizeTType(lhs.exprType) Then
 				exprType=New TSizeTType
 				exprType=New TSizeTType
 			Else If TWParamType(lhs.exprType) Then
 			Else If TWParamType(lhs.exprType) Then
@@ -2021,7 +2025,7 @@ Type TBinaryMathExpr Extends TBinaryExpr
 			Case "~~" Return x ~ y
 			Case "~~" Return x ~ y
 			Case "|" Return x | y
 			Case "|" Return x | y
 			End Select
 			End Select
-		Else If TLongType( exprType ) Or TInt128Type(exprType) Or TWParamType(exprType) Or TLParamType(exprType) 
+		Else If TLongType( exprType ) Or TInt128Type(exprType) Or TWParamType(exprType) Or TLParamType(exprType) Or TLongIntType(exprType)
 			Local x:Long=Long(lhs),y:Long=Long(rhs)
 			Local x:Long=Long(lhs),y:Long=Long(rhs)
 			Select op
 			Select op
 			Case "^" Return Double(lhs)^Double(rhs)
 			Case "^" Return Double(lhs)^Double(rhs)
@@ -2131,7 +2135,7 @@ Type TBinaryMathExpr Extends TBinaryExpr
 				Return bmx_binarymathexpr_uint(opInt, lhs, rhs)
 				Return bmx_binarymathexpr_uint(opInt, lhs, rhs)
 		End Select
 		End Select
 ?
 ?
-		Else If TULongType(exprType)
+		Else If TULongType(exprType) Or TULongIntType(exprType)
 ?bmxng
 ?bmxng
 			Local x:ULong=ULong(lhs),y:ULong=ULong(rhs)
 			Local x:ULong=ULong(lhs),y:ULong=ULong(rhs)
 			Select op
 			Select op
@@ -2314,7 +2318,7 @@ Type TBinaryCompareExpr Extends TBinaryExpr
 			Case ">"  r=(lhs> rhs)
 			Case ">"  r=(lhs> rhs)
 			Case ">=", "=>" r=(lhs>=rhs)
 			Case ">=", "=>" r=(lhs>=rhs)
 			End Select
 			End Select
-		Else If TLongType( ty ) Or TSizeTType( ty ) Or TUIntType( ty ) Or TULongType( ty ) Or TInt128Type(ty) Or TWParamType(ty) Or TLParamType(ty)
+		Else If TLongType( ty ) Or TSizeTType( ty ) Or TUIntType( ty ) Or TULongType( ty ) Or TInt128Type(ty) Or TWParamType(ty) Or TLParamType(ty) Or TLongIntType(ty) Or TULongIntType(ty)
 			Local lhs:Long=Long( Self.lhs.Eval() )
 			Local lhs:Long=Long( Self.lhs.Eval() )
 			Local rhs:Long=Long( Self.rhs.Eval() )
 			Local rhs:Long=Long( Self.rhs.Eval() )
 			Select op
 			Select op

+ 4 - 4
type.bmx

@@ -1061,12 +1061,12 @@ Type TLongIntType Extends TIntegralType
 	End Method
 	End Method
 	
 	
 	Method ExtendsType:Int( ty:TType, noExtendString:Int = False, widensTest:Int = False )
 	Method ExtendsType:Int( ty:TType, noExtendString:Int = False, widensTest:Int = False )
-		If _flags & T_VARPTR And (TIntType(ty) <> Null Or IsPointerType(ty, 0, T_POINTER)) Return True
+		If _flags & T_VARPTR And (TLongIntType(ty) <> Null Or IsPointerType(ty, 0, T_POINTER)) Return True
 		Return (widensTest And WidensToType(ty)) Or (Not widensTest And TNumericType( ty )<>Null) Or (Not noExtendString And TStringType( ty )<>Null) Or (WORD_SIZE=4 And TLParamType(ty)<>Null)
 		Return (widensTest And WidensToType(ty)) Or (Not widensTest And TNumericType( ty )<>Null) Or (Not noExtendString And TStringType( ty )<>Null) Or (WORD_SIZE=4 And TLParamType(ty)<>Null)
 	End Method
 	End Method
 
 
 	Method WidensToType:Int( ty:TType )
 	Method WidensToType:Int( ty:TType )
-		Return (IsPointerType(ty, 0, T_POINTER) And IsPointerType(Self, 0, T_POINTER)) Or (TIntType(ty)<>Null And (ty._flags & T_VAR)) Or TLongType(ty)<>Null Or TFloatType(ty)<>Null Or TDoubleType(ty)<>Null Or (WORD_SIZE=8 And TLParamType(ty)<>Null)
+		Return (IsPointerType(ty, 0, T_POINTER) And IsPointerType(Self, 0, T_POINTER)) Or (TLongIntType(ty)<>Null And (ty._flags & T_VAR)) Or TLongType(ty)<>Null Or TFloatType(ty)<>Null Or TDoubleType(ty)<>Null Or (WORD_SIZE=8 And TLParamType(ty)<>Null)
 	End Method
 	End Method
 	
 	
 	Method DistanceToType:Int(ty:TType)
 	Method DistanceToType:Int(ty:TType)
@@ -1149,12 +1149,12 @@ Type TULongIntType Extends TIntegralType
 	End Method
 	End Method
 	
 	
 	Method ExtendsType:Int( ty:TType, noExtendString:Int = False, widensTest:Int = False )
 	Method ExtendsType:Int( ty:TType, noExtendString:Int = False, widensTest:Int = False )
-		If _flags & T_VARPTR And (TIntType(ty) <> Null Or IsPointerType(ty, 0, T_POINTER)) Return True
+		If _flags & T_VARPTR And (TULongIntType(ty) <> Null Or IsPointerType(ty, 0, T_POINTER)) Return True
 		Return (widensTest And WidensToType(ty)) Or (Not widensTest And TNumericType( ty )<>Null) Or (Not noExtendString And TStringType( ty )<>Null) Or (WORD_SIZE=4 And TLParamType(ty)<>Null)
 		Return (widensTest And WidensToType(ty)) Or (Not widensTest And TNumericType( ty )<>Null) Or (Not noExtendString And TStringType( ty )<>Null) Or (WORD_SIZE=4 And TLParamType(ty)<>Null)
 	End Method
 	End Method
 
 
 	Method WidensToType:Int( ty:TType )
 	Method WidensToType:Int( ty:TType )
-		Return (IsPointerType(ty, 0, T_POINTER) And IsPointerType(Self, 0, T_POINTER)) Or (TIntType(ty)<>Null And (ty._flags & T_VAR)) Or TLongType(ty)<>Null Or TFloatType(ty)<>Null Or TDoubleType(ty)<>Null Or (WORD_SIZE=8 And TLParamType(ty)<>Null)
+		Return (IsPointerType(ty, 0, T_POINTER) And IsPointerType(Self, 0, T_POINTER)) Or (TULongIntType(ty)<>Null And (ty._flags & T_VAR)) Or TULongType(ty)<>Null Or TFloatType(ty)<>Null Or TDoubleType(ty)<>Null Or (WORD_SIZE=8 And TLParamType(ty)<>Null)
 	End Method
 	End Method
 	
 	
 	Method DistanceToType:Int(ty:TType)
 	Method DistanceToType:Int(ty:TType)