Skip to content

Allow async methods to return Task-like types#12518

Merged
cston merged 1 commit intodotnet:dev15-preview-4from
cston:tasklike-p4
Jul 19, 2016
Merged

Allow async methods to return Task-like types#12518
cston merged 1 commit intodotnet:dev15-preview-4from
cston:tasklike-p4

Conversation

@cston
Copy link
Contributor

@cston cston commented Jul 14, 2016

Allow async methods to return types other than void, Task, or Task<T>. Specifically allow Task-like types (and AsyncMethodBuilder 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.

@cston
Copy link
Contributor Author

cston commented Jul 14, 2016

@ljw1004, @dotnet/roslyn-compiler please review

Copy link
Contributor

@ljw1004 ljw1004 Jul 14, 2016

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)

@jcouv
Copy link
Member

jcouv commented Jul 15, 2016

Starting review. Sorry for the delay.

Copy link
Member

@jcouv jcouv Jul 15, 2016

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 ;-)

@jcouv
Copy link
Member

jcouv commented Jul 15, 2016

LGTM

@cston cston force-pushed the tasklike-p4 branch 2 times, most recently from 12b5d0b to 6c5c666 Compare July 19, 2016 14:41
@cston
Copy link
Contributor Author

cston commented Jul 19, 2016

@jcouv, @ljw1004 thanks for reviewing. The latest commit should cover all feedback.

@dotnet/roslyn-compiler please provide an additional review.

@MattGertz for approval.

@MattGertz
Copy link
Contributor

Approved pending the usual signoffs.

[Based on features/async-return with tests ported from that branch.]
@cston cston merged commit b828f42 into dotnet:dev15-preview-4 Jul 19, 2016
@cston cston deleted the tasklike-p4 branch July 19, 2016 21:18
@jaredpar
Copy link
Member

jaredpar commented Jul 19, 2016

Nice!!! 🎈 🎆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants