diff --git a/.gitattributes b/.gitattributes index c83ad2c554..17ab65025e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7233,6 +7233,7 @@ tests/webtbs/tw6977.pp svneol=native#text/plain tests/webtbs/tw6980.pp svneol=native#text/plain tests/webtbs/tw6989.pp svneol=native#text/plain tests/webtbs/tw7006.pp svneol=native#text/plain +tests/webtbs/tw7071.pp svneol=native#text/plain tests/webtbs/tw7100.pp svneol=native#text/plain tests/webtbs/tw7104.pp svneol=native#text/plain tests/webtbs/tw7143.pp -text diff --git a/compiler/defcmp.pas b/compiler/defcmp.pas index ec0457d77b..b5f1aecc16 100644 --- a/compiler/defcmp.pas +++ b/compiler/defcmp.pas @@ -1248,7 +1248,7 @@ implementation else { Just about everything can be converted to a formaldef...} if not (def_from.deftype in [abstractdef,errordef]) then - eq:=te_convert_l1; + eq:=te_convert_l2; end; end; diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index a4971fb424..90e834bcc3 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -1326,8 +1326,9 @@ implementation case def_to.deftype of formaldef : begin - { all types can be passed to a formaldef } - eq:=te_equal; + { all types can be passed to a formaldef, + but it is not the prefered way } + eq:=te_convert_l2; end; orddef : begin diff --git a/tests/webtbs/tw7071.pp b/tests/webtbs/tw7071.pp new file mode 100644 index 0000000000..38ae97e35e --- /dev/null +++ b/tests/webtbs/tw7071.pp @@ -0,0 +1,29 @@ +{$mode objfpc}{$H+} + +uses + Classes, SysUtils, Pipes; + +var + err : boolean; + +procedure Proc(var Buf); +begin + writeln('Proc(var Buf)'); +end; + +procedure Proc(Stream: TStream); +begin + writeln('Proc(Stream: TStream)'); + err:=false; +end; + +var + InputStream: TInputPipeStream; +begin + err:=true; + InputStream:=TInputPipeStream.Create(0); + Proc(InputStream); + if err then + halt(1); +end. +