Selaa lähdekoodia

Fixed object cast to interface compilation error.

woollybah 7 vuotta sitten
vanhempi
commit
0dc868e99b
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  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