Re: [fpc-pascal] Record Constructors which differ in parameter lists

2023-05-12 Thread Michael Van Canneyt via fpc-pascal
On Fri, 12 May 2023, Thomas Kurz via fpc-pascal wrote: I would expect the type helper to remain functional. The types are the same for all purposes except they have a different RTTI entry. But this behaviour seems inconsistent to me. For example: With "var x:double" I can use "x.IsNan". Wi

Re: [fpc-pascal] Record Constructors which differ in parameter lists

2023-05-12 Thread Thomas Kurz via fpc-pascal
> I would expect the type helper to remain functional. The types are the same > for all purposes except they have a different RTTI entry. But this behaviour seems inconsistent to me. For example: With "var x:double" I can use "x.IsNan". With TDateTime, which is defined as "type TDateTime = type

Re: [fpc-pascal] Record Constructors which differ in parameter lists

2023-05-10 Thread Michael Van Canneyt via fpc-pascal
On Wed, 10 May 2023, Thomas Kurz via fpc-pascal wrote: Dear Michael, thank you for the explanation. I understand that the helper overwrites the original constructor. But... I have defined "type TSomething = type TVec3f" (note the second "type"). So from my perspective, I'd assume that the

Re: [fpc-pascal] Record Constructors which differ in parameter lists

2023-05-10 Thread Thomas Kurz via fpc-pascal
pply to TVec3f at all because TSomething is defined as a new type, not only an alias for TVec3f. - Original Message - From: Michael Van Canneyt via fpc-pascal To: Thomas Kurz via fpc-pascal Sent: Tuesday, May 9, 2023, 23:55:47 Subject: [fpc-pascal] Record Constructors which differ in pa

Re: [fpc-pascal] Record Constructors which differ in parameter lists

2023-05-09 Thread Michael Van Canneyt via fpc-pascal
On Tue, 9 May 2023, Thomas Kurz via fpc-pascal wrote: Hello, let's take the following example: program Project1; {$MODE OBJFPC} {$MODESWITCH ADVANCEDRECORDS} {$MODESWITCH TYPEHELPERS} type TVec3f = record x, y, z: Double; constructor Create (a1, a2, a3: Double); end; type TSomething =

[fpc-pascal] Record Constructors which differ in parameter lists

2023-05-09 Thread Thomas Kurz via fpc-pascal
Hello, let's take the following example: program Project1; {$MODE OBJFPC} {$MODESWITCH ADVANCEDRECORDS} {$MODESWITCH TYPEHELPERS} type TVec3f = record x, y, z: Double; constructor Create (a1, a2, a3: Double); end; type TSomething = type TVec3f; type TSomethingHelper = type helper for TSom