소스 검색

* allow <any ordinal>(class/interface) type casts likewise it is allowed for class references and pointers

git-svn-id: trunk@7811 -
florian 18 년 전
부모
커밋
70284da435
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      compiler/defcmp.pas

+ 14 - 0
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 :