Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for variance safety for static interface members#1343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
RexJaeschke wants to merge1 commit intodotnet:draft-v9
base:draft-v9
Choose a base branch
Loading
fromRexJaeschke:add-support-for-variance-safety-for-static-interface-members

Conversation

RexJaeschke
Copy link
Contributor

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

usingSystem;usingSystem.Threading.Tasks;publicinterfaceI<outT>{staticTask<T>F=Task.FromResult(default(T));// No problemstaticTask<T>P=>Task.FromResult(default(T));//CS8904 in V8 but OK in V9staticTask<T>M()=>Task.FromResult(default(T));//CS8904 in V8 but OK in V9staticeventEventHandler<T>?E;// CS8904 in V8 but OK in V9}

The errors produced by V8 donot occur in V9.

@RexJaeschkeRexJaeschke added this to theC# 9.0 milestoneJun 9, 2025
@RexJaeschkeRexJaeschke added the type: featureThis issue describes a new feature labelJun 9, 2025
@RexJaeschkeRexJaeschke marked this pull request as draftJune 9, 2025 19:56
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
type: featureThis issue describes a new feature
Projects
None yet
Milestone
C# 9.0
Development

Successfully merging this pull request may close these issues.

1 participant
@RexJaeschke

[8]ページ先頭

©2009-2025 Movatter.jp