-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OleDbConnectionInternal.BuildInfoLiterals should return non-null #44288
Comments
Tagging subscribers to this area: @roji, @ajcvickers |
@roji Can you take a look at this along with the other nullability tweaks? |
Yep, already on my list. |
The pattern of doing: UnsafeNativeMethods.IDBInfo dbInfo = wrapper.Value;
if (null == dbInfo)
{
return false;
} ... seems common in the codebase, e.g. AddInfoKeywordsToTable does this as well. Note also that OleDbConnection.GetOleDbSchemaTable - the public method wrapping BuildInfoLiterals - also needs to return null because of GetSchemaRowset, which is also annotated to return null. There as well, the So given that this is effectively legacy code, and to be on the safe side, it seems better to leave this annotated as nullable... @krwq thoughts? |
Closing this as by-design. Can re-open if @krwq has any input. |
This method itself is internal but it affects annotations of couple of public methods.
OleDbConnectionInternal.BuildInfoLiterals code suggests that:
is likely a dead code since dbInfo is annotated as non-nullable which suggests this method will never return null.
Found when applying nullable annotations
The text was updated successfully, but these errors were encountered: