Explorar o código

Fixed object cast to interface compilation error.

woollybah %!s(int64=7) %!d(string=hai) anos
pai
achega
0dc868e99b
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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