Regression: Explicit Implementation fails to compile #34583
Labels
Area-Compilers
Bug
Feature - Nullable Reference Types
Nullable Reference Types
Tenet-Compatibility
Violation of forwards/backwards compatibility in a design-time piece.
Milestone
Version Used:
master
Steps to Reproduce:
Compile the following code:
https://sharplab.io/#v2:EYLgZgpghgLgrgJwgZwLQDs4BstWFiVKABwEsAaGEUrAH1PRggTCgGMIACASQFgAoAN4DOozgAEALJwBiAezkAeACrlOAVQB8ACmUB+TgDcoWOBACUnAO4ALZl2WcQnZDARw2MANwCAvgIFxACZOAGEARiceAWF+MQkAZglpeSVVDR19IxMzS1t7TkdnV3dPTkF/fkrAkNCQ5z4hETEpHgA6VJU1LV0DY1MLcsrfIA==
Expected Behavior:
Everything compiles without error, as it does on VS 2017:
https://sharplab.io/#v2:C4LglgNgPmB2wFMBOAzAhgYwQAgJIFgAoAbyO3OwAEAWbAMQHsGAeAFQBpsBVAPgApWAfmwA3NBACuCAJTYA7gAtkOVthDYAzsCQSMwANxEAvkSKUATNgDCARjV4ipQhSoBmKrUYsO3fkNHiUrKKytiq6lo6etjEJoRxZpZWluoEJGQUNHgAdF5snLwCwmKSMjFxRkA=
Actual Behavior:
error CS8627: A nullable type parameter must be known to be a value type or non-nullable reference type. Consider adding a 'class', 'struct', or type constraint.
error CS0539: 'C2.Foo<T, U>(T?)' in explicit interface declaration is not a member of interface
error CS0535: 'C2' does not implement interface member 'I.Foo<T, U>(T?)'
The text was updated successfully, but these errors were encountered: