Replies: 1 comment 1 reply
-
In that case, you should see the strictest assumption - outputs are nullable and inputs are not nullable. It's also harder to cover polymorphism and overrides. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The type PnP.Core.Model.IExpandoDataModel in PnP.Core includes an indexing operator that is seen as
object this[string key] { get; set; }
by my project (that has nullable enabled). But it seems that this assembly doesn't properly honour the "nullable" directive, and actually does return nulls here.Should there be a way to reference an assembly in such a way that means all reference types from it are assumed to actually be nullable? (i.e. it should be seen from my project as
object? this[string? key]
- in this case it arguably would be nicer to have it as "string key", but there's no way to automatically determine that "null" isn't a valid value for "key" here).This problem isn't hypothetical BTW - my app crashed with a NullReferenceException because of this, despite having all nullable-related warnings as errors, and not using any mechanisms to bypass nullable checking etc.
Beta Was this translation helpful? Give feedback.
All reactions