Shortcut mappings

Hi,

The documentation here https://docs.elementscompiler.com/Oxygene/Types/MappedTypes/#q=mapped mentions shortcut mappings

It gives this example

MyString = public class mapped to String
property MyLength: Integer; mapped to Length;
end;

but that doesnt compile on .net

E: Class member expected but “mapped” found [/Users/JohnMoshakis/Documents/develop/Echoes/Core/ConsoleApplication25/Program.pas (15)]
-> Phase Resolving Bodies started.
E: Property needs an expression for read or write member [/Users/JohnMoshakis/Documents/develop/Echoes/Core/ConsoleApplication25/Program.pas (15)]

Thanks
John

Curious. that does look like the correct syntax — and I see it used all over the place in, say, RTL2, but I can reproduce that your case fails. Seems like a bug, I’ll log for next week.

Thanks, logged as bugs://83800

It seems the docs where wrong for this; direct mapping is only supported for methods, because there is read and write involved for properties… The proepr syntax for properties would be

property Length: Integer read mapped.Length;

or possibly

property Length: Integer read mapped.Length write mapped.Length;

for a r/w version,.

1 Like

bugs://83800 got closed with status nochangereq.