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

Fix parameters stability inject #2081

Merged
merged 3 commits into from
Dec 17, 2024
Merged

Conversation

arnaudgiuliani
Copy link
Member

  • Fix ParametersHolder equals/hascode
  • Fix koinInject function to stabilize new parameters

@arnaudgiuliani arnaudgiuliani added this to the 4.0.1 milestone Dec 17, 2024
@arnaudgiuliani arnaudgiuliani merged commit afffe59 into 4.0.1 Dec 17, 2024
8 checks passed
@arnaudgiuliani arnaudgiuliani deleted the fix_parameters_stability_inject branch December 17, 2024 09:15
scope.get(qualifier) {
currentParameters?.invoke() ?: emptyParametersHolder()
}
val params: ParametersHolder? = parameters?.invoke()
Copy link

Choose a reason for hiding this comment

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

This is incorrect as it will recreate parameters on every recomposition

@@ -139,6 +139,16 @@ open class ParametersHolder(
}

override fun toString(): String = "DefinitionParameters${_values.toList()}"

override fun equals(other: Any?): Boolean {
if (other is ParametersHolder){
Copy link

Choose a reason for hiding this comment

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

This is incorrect as the equals check is unstable for parameter subclasses

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