C# 14 Extension Members - Property Extension Resolution Question #9517
-
Hi, I ran into this the other day and I was wondering if this case was covered anywhere: public static class CharExtensions
{
extension(char @char)
{
public char ToUpperInvariant => char.ToUpperInvariant(@char);
}
}
public class Test
{
public static void Foo()
{
// error CS8917
var upper = 'a'.ToUpperInvariant;
}
} Should this case resolve to the Should this case cause a compilation error? I'd understand if it was an instance method conflicting with an instance extension property, but in this case it seems unnecessary; it's a static method conflicting with an instance extension property on an instance. Even if there wasn't an extension property, you'd get a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
Will need to confirm expectations with WG, but this feels like a bug. Filed dotnet/roslyn#79309
Thanks for reporting!