针对 CoroutineScope 类型的参数的填充优化 #32
Merged
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.
当转换函数中存在
CoroutineScope
类型的参数时,会根据当前 receiver 尝试 将其填充至此参数。e.g.
transform function:
source:
generated:
and nullable support (推荐) .
transform function:
source:
generated:
第二种方式在接口/抽象类中使用会更加有效,因为这可以使其实现的子类不再必须显示重新标记转化函数即可享受到
CoroutineScope
的转化