You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed "Unknown" nullability was given for a nested class when the parent class contains an async method. The use case I have is I have an async unit test which use a nested test class for the unit tests of a factory method. The following is a minimal example of the problem, given the method "Test" in run in a nullable context, note that it works as expected if the async "Test" method is removed:
static void Main(string[] args)
{
// Gives Nullability: NotNullable
var data = typeof(StringData).GetProperties().First().ToContextualProperty();
// Gives Nullability: Unknown
var dataInner = typeof(Outer.StringDataInner).GetProperties().First().ToContextualProperty();
}
public class Outer
{
public async Task Test()
{
await Task.Delay(1);
}
public class StringDataInner
{
public string Text { get; } = string.Empty;
}
}
public class StringData
{
public string Text { get; } = string.Empty;
}
The text was updated successfully, but these errors were encountered:
I noticed "Unknown" nullability was given for a nested class when the parent class contains an async method. The use case I have is I have an async unit test which use a nested test class for the unit tests of a factory method. The following is a minimal example of the problem, given the method "Test" in run in a nullable context, note that it works as expected if the async "Test" method is removed:
The text was updated successfully, but these errors were encountered: