Hi Chris and Robert,
I've encountered an issue with nullable annotations. Here's what's happening:
Nullable Type Warning: I'm using a nullable type in my code, and I'm getting a warning about it (warning XS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context). I tried to enable nullable annotations but I noticed that XIDE does not have the option to enable this feature in the <PropertyGroup> section of the .xiproj file.
Using #nullable Enable/Restore: I attempted to wrap my methods with #nullable enable and #nullable restore to enable nullable annotations, but this approach resulted in a compilation error, suggesting that this case is not supported or recognized by the compiler.
I've solved my "issue" by adding the -nullable+ flag in the Additional compiler arguments, however, this feels like a temporary workaround rather than a proper solution.
regards,
Irwin.
Enabling Nullable Annotations in X# Projects
Enabling Nullable Annotations in X# Projects
XSharp Development Team (VFP)
Spain | irwin@xsharp.eu
Spain | irwin@xsharp.eu
Re: Enabling Nullable Annotations in X# Projects
Irwin,
We are not really supporting the nullable compiler flag.
Since our compiler source inherits from Roslyn, you can indeed add the command line option -nullable+, and it may work, but we did not properly test this yet.
We also do not yet support the #nullable preprocessor command
Robert
We are not really supporting the nullable compiler flag.
Since our compiler source inherits from Roslyn, you can indeed add the command line option -nullable+, and it may work, but we did not properly test this yet.
We also do not yet support the #nullable preprocessor command
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Re: Enabling Nullable Annotations in X# Projects
Hi Robert,robert wrote: Thu Feb 13, 2025 11:17 am Irwin,
We are not really supporting the nullable compiler flag.
Since our compiler source inherits from Roslyn, you can indeed add the command line option -nullable+, and it may work, but we did not properly test this yet.
We also do not yet support the #nullable preprocessor command
Robert
Thanks for the clarification. I will keep the -nullable+ flag in place to suppress the warning for now.
Irwin
XSharp Development Team (VFP)
Spain | irwin@xsharp.eu
Spain | irwin@xsharp.eu
Re: Enabling Nullable Annotations in X# Projects
Irwin,
You can also disable the warning. Adding the command line option may have unwanted (read untested) side effects.
Robert
You can also disable the warning. Adding the command line option may have unwanted (read untested) side effects.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu

