C
C#2h ago
Vasko

Have nullable types been changed?

C#
var client = clients.Find(c => c?.id == id);
if (client is null)
return Button.None;

return client.inputQueue.Dequeue();
C#
var client = clients.Find(c => c?.id == id);
if (client is null)
return Button.None;

return client.inputQueue.Dequeue();
this code should work since the null check should make client non nullable after but it doesn't. Client is still a nullable type after the check.
1 Reply
reflectronic
reflectronic1h ago
nothing has changed here, this never worked the compiler does not know that the code you wrote in the query is related to the return value

Did you find this page helpful?