浏览代码

Fixed object cast to interface compilation error.

woollybah 7 年之前
父节点
当前提交
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