[fpc-pascal] type helpers

2019-01-11 Thread Mattias Gaertner via fpc-pascal
Hi, A type helper can change Self. I wondered how FPC 3.3.1 handles properties and got some unexpected results. Is this by design, a bug, or not-yet-implemented? {$mode objfpc}{$modeswitch typehelpers} type TIntHlp = type helper for word procedure DoIt; end; TBig = class strict priva

Re: [fpc-pascal] type helpers

2019-01-11 Thread Michael Van Canneyt
On Fri, 11 Jan 2019, Mattias Gaertner via fpc-pascal wrote: Hi, A type helper can change Self. I wondered how FPC 3.3.1 handles properties and got some unexpected results. Is this by design, a bug, or not-yet-implemented? Delphi acts the same, so for FPC: by design... You will see that the

Re: [fpc-pascal] type helpers

2019-01-11 Thread Sven Barth via fpc-pascal
Am Fr., 11. Jan. 2019, 11:24 hat Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > Hi, > > A type helper can change Self. > I wondered how FPC 3.3.1 handles properties and got some > unexpected results. Is this by design, a bug, or not-yet-implemented? > > {$mode ob

Re: [fpc-pascal] type helpers

2019-01-11 Thread Michael Van Canneyt
On Fri, 11 Jan 2019, Sven Barth via fpc-pascal wrote: Am Fr., 11. Jan. 2019, 11:24 hat Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: Hi, A type helper can change Self. I wondered how FPC 3.3.1 handles properties and got some unexpected results. Is this by d

Re: [fpc-pascal] type helpers

2019-01-11 Thread Mattias Gaertner via fpc-pascal
On Fri, 11 Jan 2019 14:27:13 +0100 Sven Barth via fpc-pascal wrote: >[...] > This is by design. In this case DoIt is called on a temp variable > that gets its value from b.w, the value of b.FW does not change Ehm, in this case b.FW *does* changes. Maybe you mean the case property W: word read

Re: [fpc-pascal] type helpers

2019-01-11 Thread Sven Barth via fpc-pascal
Am Fr., 11. Jan. 2019, 14:52 hat Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> geschrieben: > On Fri, 11 Jan 2019 14:27:13 +0100 > Sven Barth via fpc-pascal wrote: > > >[...] > > This is by design. In this case DoIt is called on a temp variable > > that gets its value from b.