C#: Using dynamic object resolving results in CSC : warning AD0001: Analyzer 'Godot.SourceGenerators.MustBeVariantAnalyzer'
#91345
Labels
Milestone
Tested versions
<Project Sdk="Godot.NET.Sdk/4.2.2">
It occurs also on latest dev
System information
Windows 11, ubuntu
Issue description
I build my own C# unit test framework and have an issue with using dynamic object resolving.
When using dynamic e.g.
public static dynamic AssertThat<TValue>(TValue? current)
in combination with typed methods, it shows a warning.CSC: warning AD0001: Analyzer 'Godot.SourceGenerators.MustBeVariantAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'. [D:\development\workspace\gdUnit4Net\example\exampleProject.csproj::TargetFramework = net8.0]
This is a problem when other developers use my API and this type of warning is displayed very often.
As workaround, we can disable the warning in your project, but this should not be the standard.
<NoWarn>$(NoWarn);AD0001</NoWarn>
Steps to reproduce
Download the example project and build.
Minimal reproduction project (MRP)
AD001.zip
The text was updated successfully, but these errors were encountered: