Skip to content

Kotlin: Refactor kotlinFunctionToJavaEquivalent #10242

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

Merged
merged 2 commits into from
Sep 1, 2022

Conversation

igfoo
Copy link
Contributor

@igfoo igfoo commented Aug 31, 2022

Avoids a cast.

@igfoo igfoo requested a review from a team as a code owner August 31, 2022 14:04
if (f.isAccessor) {
val prop = javaClass.declarations.findSubType<IrProperty> { decl ->
decl.name == (f.propertyIfAccessor as IrProperty).name
(f.propertyIfAccessor as? IrProperty?)?.let { kotlinProp ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there an extra ? in as? IrProperty?? Wouldn't as? IrProperty be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks!

@igfoo igfoo merged commit ae9ba80 into github:main Sep 1, 2022
@igfoo igfoo deleted the igfoo/kotlinFunctionToJavaEquivalent branch September 1, 2022 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants