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

Add component binding to itself #7

Merged

Conversation

zagayevskiy
Copy link
Contributor

No description provided.

@daugeldauge
Copy link
Owner

Thank you for the contribution! Could you please add this feature to the compatibility list?

also remove unwanted code
@@ -124,6 +128,10 @@ internal fun KSClassDeclaration.asClassName(): ClassName {
return ClassName(packageNameString, simpleNames)
}

internal fun KSClassDeclaration.asTypeName(): TypeName {
return asStarProjectedType().asTypeName()
Copy link
Owner

Choose a reason for hiding this comment

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

This extension does something more specific than stated in its name. Maybe replace it with two calls on the usage site?

internal class ComponentBinding(
component: KSClassDeclaration,
) : Binding {
override val key = Key(component.asStarProjectedType())
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a check that a component can't be a generic class? If not maybe it's worth adding

@daugeldauge daugeldauge merged commit 213eb80 into daugeldauge:master Jan 26, 2023
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

Successfully merging this pull request may close these issues.

2 participants