We use attributes on local variables a lot, which is not supported in .NET so we want to disable it with conditional defines, the intent is to share the code between Delphi and Oxygene.
{$IFNDEF DOTNET}
var [unsafe] localVariable := SomeInterface;
{$ENDIF}
Currently the code doesn’t compile in Oxygene and is generating the following error messages:
I run the code in .NET with windows (.net standard). Both the ELEMENTS and CLR defines also don’t work. We use the [unsafe] attribute a lot in our Delphi codebase but .NET doesn’t support attributes on local parameters, hence we want to ignore the [unsafe] attribute with conditional defines.