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.
Steps to reproduce
[System.DBNull]::Value?.GetTypeCode()
Expected behavior
Actual behavior
Environment data
Build after PR https://github.com/PowerShell/PowerShell/pull/10960 is merged
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.Steps to reproduce
[System.DBNull]::Value?.GetTypeCode()Expected behavior
Actual behavior
Environment data