-
Notifications
You must be signed in to change notification settings - Fork 4k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow async methods to return Task-like types #12518
Conversation
@ljw1004, @dotnet/roslyn-compiler please review |
case SymbolKind.ArrayType: | ||
// PROTOTYPE(tasklike): Use VisitType or similar to cover all cases. | ||
break; | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think arrays, tuples and generics are the only constructed types. We'll have to make sure it works with Tuples. Whose job is that? (other than that, LGTM)
Starting review. Sorry for the delay. |
@@ -660,6 +660,7 @@ Microsoft.CodeAnalysis.Semantics.UnaryOperationKind.UnsignedPrefixIncrement = 77 | |||
abstract Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.RegisterOperationAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationAnalysisContext> action, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.OperationKind> operationKinds) -> void | |||
abstract Microsoft.CodeAnalysis.Diagnostics.OperationBlockStartAnalysisContext.RegisterOperationBlockEndAction(System.Action<Microsoft.CodeAnalysis.Diagnostics.OperationBlockAnalysisContext> action) -> void | |||
abstract Microsoft.CodeAnalysis.SemanticModel.GetOperationCore(Microsoft.CodeAnalysis.SyntaxNode node, System.Threading.CancellationToken cancellationToken) -> Microsoft.CodeAnalysis.IOperation | |||
const Microsoft.CodeAnalysis.WellKnownMemberNames.CreateAsyncMethodBuilder = "CreateAsyncMethodBuilder" -> string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only const I can find in shipped.txt and unshipped.txt. Do we really need it public?
Nevermind, I see similar public constants in src\Compilers\Core\Portable\PublicAPI.Shipped.txt ;-)
LGTM |
12b5d0b
to
6c5c666
Compare
@jcouv, @ljw1004 thanks for reviewing. The latest commit should cover all feedback. @dotnet/roslyn-compiler please provide an additional review. @MattGertz for approval. |
Approved pending the usual signoffs. |
[Based on features/async-return with tests ported from that branch.]
Nice!!! 🎈 🎆 |
Allow async methods to return types other than
void
,Task
, orTask<T>
. Specifically allowTask
-like types (andAsyncMethodBuilder
types) if the types contain the expected set of members.[Based on Lucian's prototype from
features/async-return
.]Ported PR from
master
: #12434. I will follow up on existing feedback from that PR, making changes here.