Переглянути джерело

* removed superfluous check (a procvardef can never be a constructor) and
typecasts

git-svn-id: trunk@23509 -

Jonas Maebe 12 роки тому
батько
коміт
3abc7b0d9c
1 змінених файлів з 2 додано та 4 видалено
  1. 2 4
      compiler/jvm/njvmcal.pas

+ 2 - 4
compiler/jvm/njvmcal.pas

@@ -383,13 +383,11 @@ implementation
         { when calling a constructor, first create a new instance, except
         { when calling a constructor, first create a new instance, except
           when calling it from another constructor (because then this has
           when calling it from another constructor (because then this has
           already been done before calling the current constructor) }
           already been done before calling the current constructor) }
-        if procdefinition.typ<>procdef then
-          exit;
-        if tabstractprocdef(procdefinition).proctypeoption<>potype_constructor then
+        if procdefinition.proctypeoption<>potype_constructor then
           exit;
           exit;
         if not(methodpointer.resultdef.typ in [classrefdef,recorddef]) then
         if not(methodpointer.resultdef.typ in [classrefdef,recorddef]) then
           exit;
           exit;
-        current_asmdata.CurrAsmList.concat(taicpu.op_sym(a_new,current_asmdata.RefAsmSymbol(tabstractrecorddef(tabstractprocdef(procdefinition).owner.defowner).jvm_full_typename(true))));
+        current_asmdata.CurrAsmList.concat(taicpu.op_sym(a_new,current_asmdata.RefAsmSymbol(tabstractrecorddef(procdefinition.owner.defowner).jvm_full_typename(true))));
         { the constructor doesn't return anything, so put a duplicate of the
         { the constructor doesn't return anything, so put a duplicate of the
           self pointer on the evaluation stack for use as function result
           self pointer on the evaluation stack for use as function result
           after the constructor has run }
           after the constructor has run }