Since the implementation of ?. operator treats DBNull, NullString and AutomationNull as null, we cannot call any method on them using ?. operator. The concern is only for DBNull as for other types we truly consider them as null.
[System.DBNull]::Value?.GetTypeCode()
DBNull
null
Build after PR https://github.com/PowerShell/PowerShell/pull/10960 is merged
                        This will also affect NullString.Value -- if you are referencing LanguagePrimitives.IsNullLike() anywhere in the implementation of ?. or ?[] you probably want to switch to LanguagePrimitives.IsNull()
Yes I think we either agree that ?. uses IsNullLike(), in which case I think this is by design, or we use IsNull(), in which case there's a change to make.
I feel we've already crossed this bridge once we decided awhile back that [System.DBNull]::Value -eq $null so usage expects it to act like it was $null (current design) otherwise it'll confuse users with the inconsistency.  They can always workaround this by not using this operator.
@SteveL-MSFT Can we close the issue? It seems we revert PR for DBNull.
Most helpful comment
I feel we've already crossed this bridge once we decided awhile back that
[System.DBNull]::Value -eq $nullso usage expects it to act like it was$null(current design) otherwise it'll confuse users with the inconsistency. They can always workaround this by not using this operator.