To reproduce:
Rock.Create<TimeProvider>()
That's it. The error is because of the way CreateTimer() is defined:
public virtual ITimer CreateTimer(TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period)
It's odd because I'm almost positive I've run into this before and handled it, or....not? The issue is I emit [NullableAttribute] for the state parameter in the mock, and this causes CS8623. Looking at GetDescription(), it appears that I don't filter that attribute out, but I'm surprised I haven't seen this error before.
It's possible this is a new diagnostic in .NET 8/C# 12, as this occurred when I targeted .NET 8.
To reproduce:
Rock.Create<TimeProvider>()That's it. The error is because of the way
CreateTimer()is defined:It's odd because I'm almost positive I've run into this before and handled it, or....not? The issue is I emit
[NullableAttribute]for thestateparameter in the mock, and this causesCS8623. Looking atGetDescription(), it appears that I don't filter that attribute out, but I'm surprised I haven't seen this error before.It's possible this is a new diagnostic in .NET 8/C# 12, as this occurred when I targeted .NET 8.