-
Notifications
You must be signed in to change notification settings - Fork 286
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
Add support for context receivers @PropertySpec and fix issues with annotations #1247
Add support for context receivers @PropertySpec and fix issues with annotations #1247
Conversation
Prevent context receivers on accessors Add FunSpec tests: - Annotated function with context receiver - Accessor with context receiver Add context receivers to PropertySpec Add PropertySpec tests: - Var with context receiver - Val without getter with context receiver - Val with context receiver - Annotated val with context receiver
kotlinpoet/src/main/java/com/squareup/kotlinpoet/PropertySpec.kt
Outdated
Show resolved
Hide resolved
kotlinpoet/src/test/java/com/squareup/kotlinpoet/PropertySpecTest.kt
Outdated
Show resolved
Hide resolved
kotlinpoet/src/test/java/com/squareup/kotlinpoet/PropertySpecTest.kt
Outdated
Show resolved
Hide resolved
Update tests for vars with context receivers without custom accessors Add test for var with context receivers and custom accessors Fix code style
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.
Looks good! Added a single suggestion, otherwise good to merge - thanks!
kotlinpoet/src/main/java/com/squareup/kotlinpoet/PropertySpec.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Egor Andreevich <github@egorand.dev>
@Egorand will the snapshot repository be updated with this? I really need this fix to publish my library |
Yes! As soon as it's merged CI will publish a fresh snapshot. |
@Egorand Please recheck as I just accepted your suggestion earlier today and had to update the tests right now. Thank you! |
Merging, thank you! |
Summary
As discussed in #1244, here is a PR to add support for context receivers @
PropertySpec
.Proposed Changes
contextReceivers
available inPropertySpec
builderFunSpec
to throw exception when a context receiver is added to an accessor