Skip to content

Conversation

RexJaeschke
Copy link
Contributor

I just discovered this V9 feature spec here. To make sure this was actually implemented in V9, I compiled the following code:

using System;
using System.Threading.Tasks;

public interface I<out T>
{
    static Task<T> F = Task.FromResult(default(T)); // No problem
    static Task<T> P => Task.FromResult(default(T));   //CS8904 in V8 but OK in V9
    static Task<T> M() => Task.FromResult(default(T));    //CS8904 in V8 but OK in V9
    static event EventHandler<T>? E; // CS8904 in V8 but OK in V9
}

The errors produced by V8 do not occur in V9.

@RexJaeschke RexJaeschke added this to the C# 9.0 milestone Jun 9, 2025
@RexJaeschke RexJaeschke added the type: feature This issue describes a new feature label Jun 9, 2025
@RexJaeschke RexJaeschke marked this pull request as draft June 9, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature This issue describes a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant