From 70284da435f40608bb44cd593e5856341988dbe0 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 25 Jun 2007 20:08:34 +0000 Subject: [PATCH] * allow (class/interface) type casts likewise it is allowed for class references and pointers git-svn-id: trunk@7811 - --- compiler/defcmp.pas | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/compiler/defcmp.pas b/compiler/defcmp.pas index 0adff612d1..0b5f8e5f5f 100644 --- a/compiler/defcmp.pas +++ b/compiler/defcmp.pas @@ -275,6 +275,20 @@ implementation eq:=te_convert_l2; end; end; + objectdef: + begin + if is_class_or_interface_or_dispinterface(def_from) and (cdo_explicit in cdoptions) then + begin + eq:=te_convert_l1; + if (fromtreetype=niln) then + begin + { will be handled by the constant folding } + doconv:=tc_equal; + end + else + doconv:=tc_int_2_int; + end; + end; classrefdef, procvardef, pointerdef :