Enforcing null-oblivious types at nullable boundaries? #4806
Unanswered
shawnnapora
asked this question in
Q&A
Replies: 1 comment 4 replies
-
We hope that when we manage to ship #2145 that people will adopt it for parameters of public APIs when there's a possibility that their caller is null-oblivious. |
Beta Was this translation helpful? Give feedback.
4 replies
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.
-
👋 My team has adopted nullable types, but we've been running into some issues when interacting with dependencies that have not yet also enabled nullable types. When interacting with those, we find that the libraries are null-oblivious, and our nullable checking fails since it doesn't warn about consuming null-oblivious into non-nullable types. Since we mentally expect in our nullable-enabled code to not run into that class of issues (since the compiler has been doing lots of nice checks for us), this is proving problematic and we're running into null refs in production code 🙀
I think in the ideal world, we'd be able to specify how we want certain libraries to behave when consuming them; that is, potentially have the compiler emit warnings when consuming oblivious types into non-nullable types for maximum safety.
How are other folks handling the "taint" of consuming null-oblivious types from libraries?
Beta Was this translation helpful? Give feedback.
All reactions