Browse Source

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

git-svn-id: trunk@23509 -

Jonas Maebe 12 years ago
parent
commit
3abc7b0d9c
1 changed files with 2 additions and 4 deletions
  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 it from another constructor (because then this has
           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;
         if not(methodpointer.resultdef.typ in [classrefdef,recorddef]) then
           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
           self pointer on the evaluation stack for use as function result
           after the constructor has run }