2
0
Эх сурвалжийг харах

Fixed object cast to interface compilation error.

woollybah 7 жил өмнө
parent
commit
0dc868e99b
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      expr.bmx

+ 5 - 0
expr.bmx

@@ -1487,6 +1487,11 @@ Type TCastExpr Extends TExpr
 			Return Self
 		End If
 
+		If TObjectType(ty) And TObjectType(src) And TObjectType(ty).classdecl.IsInterface() And flags & CAST_EXPLICIT Then
+			exprType = ty
+			Return Self
+		End If
+
 		If Not exprType
 			Err "Unable to convert from "+src.ToString()+" to "+ty.ToString()+"."
 		EndIf