diff --git a/.gitattributes b/.gitattributes index 03e300a8e6..e2ce130409 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8228,6 +8228,7 @@ tests/webtbf/tw12365b.pp svneol=native#text/plain tests/webtbf/tw1238.pp svneol=native#text/plain tests/webtbf/tw1251a.pp svneol=native#text/plain tests/webtbf/tw1270.pp svneol=native#text/plain +tests/webtbf/tw12933.pp svneol=native#text/plain tests/webtbf/tw1306.pp svneol=native#text/plain tests/webtbf/tw1316.pp svneol=native#text/plain tests/webtbf/tw1328.pp svneol=native#text/plain diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index 465f967048..2ed37f0651 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -1495,8 +1495,13 @@ implementation { if they are objects } if (def_from.typ=objectdef) and ( - not(m_delphi in current_settings.modeswitches) or ( + not(m_delphi in current_settings.modeswitches) and + (tobjectdef(def_from).objecttype in [odt_object,odt_class]) and + (tobjectdef(def_to).objecttype in [odt_object,odt_class]) + ) or + ( + (m_delphi in current_settings.modeswitches) and (tobjectdef(def_from).objecttype=odt_object) and (tobjectdef(def_to).objecttype=odt_object) ) diff --git a/tests/webtbf/tw12933.pp b/tests/webtbf/tw12933.pp new file mode 100644 index 0000000000..2f193f16b5 --- /dev/null +++ b/tests/webtbf/tw12933.pp @@ -0,0 +1,20 @@ +{ %fail } + +{$mode objfpc} + +type + ta = interface + end; + + tb = interface(ta) + end; + +procedure test(var a: ta); +begin +end; + +var + b: tb; +begin + test(b); +end.