Open madelson opened 3 years ago
Still present in 16.9. Somehow, the type argument to Baz
is inferred to be T?
. SharpLab
A few things are probably interacting to produce this behavior:
ConstantValue
on the parameter symbol, the nullability suppression on the default value is lost.ConstantValue
. This default
is then included in the nullable type argument reinference process.Perhaps we can fix this bug by making it so implicit default arguments don't "participate" in nullable type argument reinference.
Version Used:
Visual Studio 16.8.3 compiling against netstandard2.0 with LangVersion 8.0 on Windows 10.
Steps to Reproduce:
Error:
Expected Behavior:
This used to compile without error, so I would expect it to continue to.
Actual Behavior:
Fails with the error above.