Skip to content
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

CoroutineScope "context" shadows Android context #75

Closed
mttmllns opened this issue Jun 19, 2017 · 3 comments
Closed

CoroutineScope "context" shadows Android context #75

mttmllns opened this issue Jun 19, 2017 · 3 comments

Comments

@mttmllns
Copy link

mttmllns commented Jun 19, 2017

In Android Activities, Fragments, and Views there is a getContext() method that is used frequently. When used with Kotlin the IDE suggests using property access syntax with the synthetic property context. This is shadowed when using an async or launch coroutine block, though, by the CoroutineContext context of CoroutineScope.

We can use getContext() instead and it's not the end of the world, but I wanted to file the issue to see if there should instead be an alternate name for the CoroutineContext. I imagine many people will run into this "issue" whether writing code or reading other's code and getting confused by the two different "contexts".

Cheers.

@elizarov
Copy link
Contributor

The tentative plan is to rename it coroutineContext. Stay tuned.

@elizarov
Copy link
Contributor

Committed rename of context to coroutineContext into develop branch.

@elizarov
Copy link
Contributor

Released in version 0.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants