Skip to content

Commit a5de69f

Browse files
daniCsorbaJBsarahhaggarty
authored andcommitted
update: adding info for KTLC-268/ KT-71822
1 parent 75d47a3 commit a5de69f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/topics/compatibility-guides/compatibility-guide-23.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,23 @@ perspective (for example, from Java) is out of the scope of this document.
132132
>
133133
> - 2.3.20: Unify Kotlin/Native exception stacktrace formatting with other Kotlin platforms
134134
135+
### Correct `Iterable<T>.intersect()` and `Iterable<T>.subtract()` behavior for referential-equality collections
136+
137+
> **Issue**: [KTLC-268](https://youtrack.jetbrains.com/issue/KTLC-268)
138+
>
139+
> **Component**: kotlin-stdlib
140+
>
141+
> **Incompatible change type**: behavioral
142+
>
143+
> **Short summary**: The [`Iterable<T>.intersect()`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/intersect.html) and [`Iterable<T>.subtract()`](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/subtract.html) functions now test membership for each
144+
> receiver element before adding it to the result set.
145+
> The result set compares elements using `Any::equals`,
146+
> ensuring correct results even when the argument collection uses referential equality (for example, `IdentityHashMap.keys˙).
147+
>
148+
> **Deprecation cycle**:
149+
>
150+
> - 2.3.0: enable the new behavior
151+
135152
## Tools
136153

137154
### Correct `setSource()` function in `KotlinCompileTool` to replace sources

0 commit comments

Comments
 (0)