Преглед изворни кода

Fixed rhs function ptr issue. Fixes #240.

woollybah пре 8 година
родитељ
комит
0d040f022e
2 измењених фајлова са 13 додато и 1 уклоњено
  1. 8 1
      expr.bmx
  2. 5 0
      type.bmx

+ 8 - 1
expr.bmx

@@ -686,6 +686,9 @@ Type TInvokeExpr Extends TExpr
 
 		If ((isArg Or isRhs) And Not invokedWithBraces) And (args = Null Or args.length = 0) Then
 			' nothing to do here, as we are probably a function pointer. i.e. no braces and no 
+			' and our expression type is a function ptr...
+			exprType = New TFunctionPtrType.Create(decl)
+			
 		Else
 			args=CastArgs( args,decl )
 		End If
@@ -1634,9 +1637,13 @@ Type TBinaryMathExpr Extends TBinaryExpr
 		If exprType Return Self
 
 		lhs=lhs.Semant()
+
+		If TIdentExpr(rhs) Then
+			TIdentExpr(rhs).isRhs = True
+		End If
+
 		rhs=rhs.Semant()
 		
-		
 		' operator overload?
 		If TObjectType(lhs.exprType) Then
 			Local args:TExpr[] = [rhs]

+ 5 - 0
type.bmx

@@ -1733,6 +1733,11 @@ End Type
 Type TFunctionPtrType Extends TType
 
 	Field func:TFuncDecl
+	
+	Method Create:TFunctionPtrType(func:TFuncDecl)
+		Self.func = func
+		Return Self
+	End Method
 
 	Method EqualsType:Int( ty:TType )
 ' TODO : compare function decl