* probably mark an overloaded := operator used as type conversion as used, resolves #18909

git-svn-id: trunk@17320 -
This commit is contained in:
florian 2011-04-14 21:11:27 +00:00
parent 6bca660e76
commit 58fcf9dc52
5 changed files with 44 additions and 2 deletions

3
.gitattributes vendored
View File

@ -11283,6 +11283,7 @@ tests/webtbs/tw1883.pp svneol=native#text/plain
tests/webtbs/tw18859.pp svneol=native#text/plain
tests/webtbs/tw1888.pp svneol=native#text/plain
tests/webtbs/tw1889.pp svneol=native#text/plain
tests/webtbs/tw18909.pp svneol=native#text/pascal
tests/webtbs/tw1896.pp svneol=native#text/plain
tests/webtbs/tw1901.pp svneol=native#text/plain
tests/webtbs/tw1902.pp svneol=native#text/plain
@ -12123,6 +12124,8 @@ tests/webtbs/uw17493.pp svneol=native#text/plain
tests/webtbs/uw17950.pas svneol=native#text/pascal
tests/webtbs/uw18087a.pp svneol=native#text/pascal
tests/webtbs/uw18087b.pp svneol=native#text/pascal
tests/webtbs/uw18909a.pp svneol=native#text/pascal
tests/webtbs/uw18909b.pp svneol=native#text/pascal
tests/webtbs/uw2004.inc svneol=native#text/plain
tests/webtbs/uw2040.pp svneol=native#text/plain
tests/webtbs/uw2266a.inc svneol=native#text/plain

View File

@ -187,7 +187,7 @@ interface
procedure second_nothing; virtual;abstract;
end;
ttypeconvnodeclass = class of ttypeconvnode;
{ common functionality of as-nodes and is-nodes }
tasisnode = class(tbinarynode)
public
@ -1798,7 +1798,7 @@ implementation
te_convert_operator :
begin
include(current_procinfo.flags,pi_do_call);
aprocdef.procsym.IncRefCountBy(1);
addsymref(aprocdef.procsym);
hp:=ccallnode.create(ccallparanode.create(left,nil),Tprocsym(aprocdef.procsym),nil,nil,[]);
{ tell explicitly which def we must use !! (PM) }
tcallnode(hp).procdefinition:=aprocdef;

9
tests/webtbs/tw18909.pp Normal file
View File

@ -0,0 +1,9 @@
{$mode objfpc}
uses uw18909a, uw18909b;
var
a: TA = (x: 1);
b: TB = (x: 1);
begin
b := a;
Write(b.x);
end.

14
tests/webtbs/uw18909a.pp Normal file
View File

@ -0,0 +1,14 @@
{ %norun }
unit uw18909a;
{$mode objfpc}
interface
type
TA = record x: Integer; end;
TB = record x: Integer; end;
implementation
end.

16
tests/webtbs/uw18909b.pp Normal file
View File

@ -0,0 +1,16 @@
{ %norun }
unit uw18909b;
{$mode objfpc}
interface
uses uw18909a;
operator :=(const A: TA): TB;
implementation
operator :=(const A: TA): TB; begin Result.x := A.x; end;
end.