diff --git a/.gitattributes b/.gitattributes index c81eb35b43..3e4e711fc0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12777,6 +12777,7 @@ tests/webtbs/tw2250.pp svneol=native#text/plain tests/webtbs/tw22502.pp svneol=native#text/plain tests/webtbs/tw22561.pp svneol=native#text/plain tests/webtbs/tw2259.pp svneol=native#text/plain +tests/webtbs/tw22593.pp svneol=native#text/plain tests/webtbs/tw2260.pp svneol=native#text/plain tests/webtbs/tw2266.pp svneol=native#text/plain tests/webtbs/tw2267.pp svneol=native#text/plain diff --git a/compiler/defcmp.pas b/compiler/defcmp.pas index b8267a01b5..fe49c84f43 100644 --- a/compiler/defcmp.pas +++ b/compiler/defcmp.pas @@ -1560,7 +1560,8 @@ implementation if assigned(def_to.typesym) and (tclassrefdef(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 new file mode 100644 index 0000000000..bafe85ce76 --- /dev/null +++ b/tests/webtbs/tw22593.pp @@ -0,0 +1,25 @@ +{ %norun } + +{$ifdef fpc} +{$mode objfpc} +{$endif} + +type + tc = class + end; + tcc = class of tc; + tc3 = class; + + tc2 = class + constructor create(c: tcc = nil; c3: tc3 = nil); + end; + + tc3 = class + end; + +constructor tc2.create(c: tcc = nil; c3: tc3 = nil); +begin +end; + +begin +end.