This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Core] Missing await in Device.InvokeOnMainThreadAsync(Func<Task>) #6718
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WithAsyncTask is expected to fail.
samhouts
suggested changes
Jul 4, 2019
samhouts
suggested changes
Jul 9, 2019
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.
Build fails on OSX:
Device.cs(128,11): error CS0121: The call is ambiguous between the following methods or properties: 'Device.InvokeOnMainThreadAsync(Action)' and 'Device.InvokeOnMainThreadAsync(Func<Task>)'
CS0121: The call is ambiguous between the following methods or properties: 'Device.InvokeOnMainThreadAsync(Action)' and 'Device.InvokeOnMainThreadAsync(Func<Task>)' dotnet/roslyn#14885 dotnet/csharplang#98
StephaneDelcroix
approved these changes
Jul 10, 2019
samhouts
approved these changes
Jul 16, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Stumbled on #5028 as I was considering submitting an equivalent PR myself, and happened to notice a bug:
InvokeOnMainThreadAsync(Func<Task>)
doesn'tawait
. I had originally just fixed the bug (note commit timestamps), but figured I might as well practice writing async tests.Update: Apparently this was reported as #6705 and the fix in #6708 was merged an hour ago. Maybe the rest is still useful?
Also:
dummyFunc
more useful namesRenamedfunc
/funcTask
tofunction
, in alignment withTask.Run(...)
overloadsAPI Changes
Changed:
Names of some public arguments fromfunc
/funcTask
tofunction
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
Tried breaking the working code to hit each
Assert
.PR Checklist