Browse Source

Disallow incompatible assignment of function pointers involving Var parameters

HurryStarfish 8 years ago
parent
commit
202469b2bf
1 changed files with 3 additions and 3 deletions
  1. 3 3
      type.bmx

+ 3 - 3
type.bmx

@@ -1742,10 +1742,10 @@ Type TFunctionPtrType Extends TType
 	Method EqualsType:Int( ty:TType )
 		If Not TFunctionPtrType(ty) Then Return False
 		Local tyfunc:TFuncDecl = TFunctionPtrType(ty).func
-		If Not func.retType.EqualsType(tyfunc.retType) Then Return False
-		If Not (func.argDecls.Length = tyfunc.argDecls.Length) Then Return False
+		If Not tyfunc.retType.EqualsType(func.retType) Then Return False
+		If Not (tyfunc.argDecls.Length = func.argDecls.Length) Then Return False
 		For Local a:Int = 0 Until func.argDecls.Length
-			If Not func.argDecls[a].ty.EqualsType(tyfunc.argDecls[a].ty) Then Return False
+			If Not tyfunc.argDecls[a].ty.EqualsType(func.argDecls[a].ty) Then Return False
 		Next
 		Return True
 	End Method