diff --git a/compiler/defcmp.pas b/compiler/defcmp.pas index fe49c84f43..495517d076 100644 --- a/compiler/defcmp.pas +++ b/compiler/defcmp.pas @@ -1222,7 +1222,8 @@ implementation if assigned(def_to.typesym) and (tpointerdef(def_to).pointeddef.typ=forwarddef) then begin - if (def_from.typesym=def_to.typesym) then + if (def_from.typesym=def_to.typesym) or + (fromtreetype=niln) then eq:=te_equal end else diff --git a/tests/webtbs/tw22593.pp b/tests/webtbs/tw22593.pp index bafe85ce76..775923c1f5 100644 --- a/tests/webtbs/tw22593.pp +++ b/tests/webtbs/tw22593.pp @@ -10,14 +10,19 @@ type tcc = class of tc; tc3 = class; + tprec = ^trec; + tc2 = class - constructor create(c: tcc = nil; c3: tc3 = nil); + constructor create(c: tcc = nil; c3: tc3 = nil; r: tprec = nil); + end; + + trec = record end; tc3 = class end; -constructor tc2.create(c: tcc = nil; c3: tc3 = nil); +constructor tc2.create(c: tcc = nil; c3: tc3 = nil; r: tprec = nil); begin end;