Browse Source

Fix position of call to simplify method as suggested by Jonas

Pierre Muller 2 years ago
parent
commit
63d15d3258
1 changed files with 9 additions and 11 deletions
  1. 9 11
      compiler/ncnv.pas

+ 9 - 11
compiler/ncnv.pas

@@ -3173,20 +3173,18 @@ implementation
                          else
                            begin
                              if ((((resultdef.typ=objectdef) and (left.resultdef.typ=classrefdef))
-                                 or ((left.resultdef.typ=objectdef) and (resultdef.typ=classrefdef)))
-                                 and not (nf_internal in flags)) then
+                                  or ((left.resultdef.typ=objectdef) and (resultdef.typ=classrefdef))) and
+                                 not (nf_internal in flags)) then
                                if not(m_delphi in current_settings.modeswitches) then
                                  CGMessage2(type_e_illegal_type_conversion,left.resultdef.typename,resultdef.typename)
                                else
-                                 begin
-                                   CGMessage2(type_w_dangerous_type_conversion,left.resultdef.typename,resultdef.typename);
-			           { perform target-specific explicit typecast checks }
-                                   if target_specific_explicit_typeconv then
-                                     begin
-                                       result:=simplify(false);
-                                       exit;
-                                     end;
-                                 end;
+                                 CGMessage2(type_w_dangerous_type_conversion,left.resultdef.typename,resultdef.typename);
+                           end;
+                         { perform target-specific explicit typecast checks }
+                         if target_specific_explicit_typeconv then
+                           begin
+                             result:=simplify(false);
+                             exit;
                            end;
                        end;
                    end