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 Kotlin user projects build #2341

Merged
merged 2 commits into from
Jun 23, 2023
Merged

Fix Kotlin user projects build #2341

merged 2 commits into from
Jun 23, 2023

Conversation

qurbonzoda
Copy link
Contributor

  • Removes @SharedImmutable usages
  • Suppresses animal sniffer validation error

@sandwwraith
Copy link
Member

  1. Can you open PR against dev please?
  2. Am I right that starting with Kotlin 1.8 @SharedImmutable does nothing anyway and can be safely removed?

@qwwdfsad qwwdfsad requested review from sandwwraith and removed request for qwwdfsad June 21, 2023 13:53
The annotation is deprecated and has no effect.
The error is a result of changes in data class hashCode generation.
The generated code now uses the static Boolean.hashCode() to calculate hash code of boolean properties. The static function is available only since Java 1.8.
@qurbonzoda qurbonzoda changed the base branch from master to dev June 21, 2023 23:00
@qurbonzoda
Copy link
Contributor Author

  • Can you open PR against dev please?

Done

  • Am I right that starting with Kotlin 1.8 @SharedImmutable does nothing anyway and can be safely removed?

@SharedImmutable does nothing in the new K/N memory manager, which is the default one since 1.7.20.
The legacy memory manager is removed completely in 1.9.20, and their is no way to switch back to it.
So the answer is yes. @SharedImmutable does nothing and can be safely removed.

@sandwwraith
Copy link
Member

We plan to do a release with Kotlin 1.9.0. If someone uses old memory manager, it means theirs code will break without this annotation?

@qurbonzoda
Copy link
Contributor Author

We plan to do a release with Kotlin 1.9.0. If someone uses old memory manager

According to Native team user programs will fail at runtime if the references are used by multiple threads.

@qwwdfsad
Copy link
Collaborator

If someone uses old memory manager

We don't have to support it anymore

@sandwwraith sandwwraith merged commit d192d24 into dev Jun 23, 2023
3 checks passed
sandwwraith pushed a commit that referenced this pull request Jun 26, 2023
* Remove @SharedImmutable usages

The annotation is deprecated and has no effect.

* Suppress animal sniffer error in a data class with boolean property

The error is a result of changes in data class hashCode generation.
The generated code now uses the static Boolean.hashCode() to calculate hash code of boolean properties. The static function is available only since Java 1.8.

(cherry-picked from: d192d24)
LeonidSandal pushed a commit that referenced this pull request Jun 29, 2023
* Remove @SharedImmutable usages

The annotation is deprecated and has no effect.

* Suppress animal sniffer error in a data class with boolean property

The error is a result of changes in data class hashCode generation.
The generated code now uses the static Boolean.hashCode() to calculate hash code of boolean properties. The static function is available only since Java 1.8.

(cherry-picked from: d192d24)
LeonidSandal pushed a commit that referenced this pull request Jun 29, 2023
* Remove @SharedImmutable usages

The annotation is deprecated and has no effect.

* Suppress animal sniffer error in a data class with boolean property

The error is a result of changes in data class hashCode generation.
The generated code now uses the static Boolean.hashCode() to calculate hash code of boolean properties. The static function is available only since Java 1.8.

(cherry-picked from: d192d24)
JesusMcCloud pushed a commit to a-sit-plus/kotlinx.serialization that referenced this pull request Jul 5, 2023
* Remove @SharedImmutable usages

The annotation is deprecated and has no effect.

* Suppress animal sniffer error in a data class with boolean property

The error is a result of changes in data class hashCode generation.
The generated code now uses the static Boolean.hashCode() to calculate hash code of boolean properties. The static function is available only since Java 1.8.
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.

None yet

3 participants