Skip to content

Commit 85020dd

Browse files
committed
language tickets
1 parent a5de69f commit 85020dd

File tree

1 file changed

+144
-16
lines changed

1 file changed

+144
-16
lines changed

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

Lines changed: 144 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,172 @@ perspective (for example, from Java) is out of the scope of this document.
2323

2424
## Language
2525

26-
### Remove language versions 1.8 and 1.9
26+
### Drop support in `-language-version` for 1.8 and 1.9
2727

2828
> **Issue**: [KT-76343](https://youtrack.jetbrains.com/issue/KT-76343), [KT-76344](https://youtrack.jetbrains.com/issue/KT-76344).
2929
>
30-
> **Component**: Core language
30+
> **Component**: Compiler
3131
>
3232
> **Incompatible change type**: source
3333
>
34-
> **Short summary**: Kotlin 2.3 introduces language version 2.3 and removes support for language version 1.8.
35-
> Support for language version 1.9 is also removed for non-JVM platforms. Language versions 1.8 and 1.9 are deprecated.
34+
> **Short summary**: Starting with Kotlin 2.3, the compiler no longer supports [`-language-version=1.8`](compiler-reference.md#language-version-version).
35+
> Support for `-language-version=1.9` is also removed for non-JVM platforms.
3636
>
3737
> **Deprecation cycle**:
3838
>
39-
> - 2.2.0: report a warning for language versions 1.8 and 1.9
39+
> - 2.2.0: report a warning when using `-language-version` with versions 1.8 and 1.9.
4040
> - 2.3.0: raise the warning to an error for language version 1.8 on all platforms and for language version 1.9 on non-JVM platforms.
4141
42-
### Enable invokedynamic for annotated lambdas by default
42+
### Handle `UPPER_BOUND_VIOLATED` on implicit type arguments
43+
44+
> **Issue**: [KTLC-287](https://youtrack.jetbrains.com/issue/KTLC-287)
45+
>
46+
> **Component**: Core language
47+
>
48+
> **Incompatible change type**: behavioral
49+
>
50+
> **Short summary**: Previously, the compiler never reported `UPPER_BOUND_VIOLATED` for implicit type parameters. This
51+
> has been fixed in Kotlin 2.3.0 so that `UPPER_BOUND_VIOLATED` is reported consistently across all type parameters.
52+
>
53+
> **Deprecation cycle**:
54+
>
55+
> - 2.2.20: report deprecation warnings for bounds violations by implicit type arguments
56+
> - 2.3.0: raise the warning to an error for `UPPER_BOUND_VIOLATED` on implicit type arguments
57+
58+
### Prohibit `@JvmSerializableLambda` annotation on `inline` and `crossinline` lambdas
59+
60+
> **Issue**: [KTLC-9](https://youtrack.jetbrains.com/issue/KTLC-9)
61+
>
62+
> **Component**: Core language
63+
>
64+
> **Incompatible change type**: behavioral
65+
>
66+
> **Short summary**: Prohibit adding the `@JvmSerializableLambda` annotation on `inline` and `crossinline` lambdas
67+
> because it has no effect. `inline` and `crossinline` lambdas are not serializable.
68+
>
69+
> **Deprecation cycle**:
70+
>
71+
> - 2.1.20: report a warning when the `@JvmSerializableLambda` is applied to `inline` and `crossinline` lambdas
72+
> - 2.3.0: raise the warning to an error; this change can be enabled in progressive mode
73+
74+
### Prohibit delegating a Kotlin interface to a Java class when the generic signatures don't match
75+
76+
> **Issue**: [KTLC-267](https://youtrack.jetbrains.com/issue/KTLC-267)
77+
>
78+
> **Component**: Core language
79+
>
80+
> **Incompatible change type**: behavioral
81+
>
82+
> **Short summary**: Kotlin 2.3.0 forbids delegation to a Java class that implements a generic interface method with
83+
> a non-generic override. Previously, allowing this behavior led to type mismatches and `ClassCastException` reported at runtime.
84+
> This change shifts the error from runtime to compile time.
85+
>
86+
> **Deprecation cycle**:
87+
>
88+
> - 2.1.20: report a warning
89+
> - 2.3.0: raise the warning to an error
90+
91+
### Deprecate unintended use of `return` in expression-bodied functions without explicit return type
92+
93+
> **Issue**: [KTLC-288](https://youtrack.jetbrains.com/issue/KTLC-288)
94+
>
95+
> **Component**: Core language
96+
>
97+
> **Incompatible change type**: behavioral
98+
>
99+
> **Short summary**: Kotlin now deprecates using `return` inside expression bodies when the function's return type is not
100+
> explicitly declared.
101+
>
102+
> **Deprecation cycle**:
103+
>
104+
> - 2.3.0: report a warning
105+
> - 2.4.0: raise the warning to an error
106+
107+
### Prohibit inheritance from nullable supertypes introduced via typealias
108+
109+
> **Issue**: [KTLC-279](https://youtrack.jetbrains.com/issue/KTLC-279)
110+
>
111+
> **Component**: Core language
112+
>
113+
> **Incompatible change type**: behavioral
114+
>
115+
> **Short summary**: Kotlin now reports an error when attempting to inherit from a nullable typealias, consistent with
116+
> how it already handles direct nullable supertypes.
117+
>
118+
> **Deprecation cycle**:
119+
>
120+
> - 2.2.0: report a warning
121+
> - 2.3.0: raise the warning to an error
122+
123+
### Unify generic signature generation for top-level lambdas and call arguments
124+
125+
> **Issue**: [KTLC-277](https://youtrack.jetbrains.com/issue/KTLC-277)
126+
>
127+
> **Component**: Core language
128+
>
129+
> **Incompatible change type**: behavioral
130+
>
131+
> **Short summary**: Kotlin 2.3 uses the same type-checking logic for top-level lambdas as it does for lambdas passed
132+
> as call arguments, ensuring consistent generic signature generation across both cases.
133+
>
134+
> **Deprecation cycle**:
135+
>
136+
> - 2.3.0: introduce new behavior; not applicable for progressive mode
137+
138+
### Prohibit reified type parameters from being inferred as intersection types
139+
140+
> **Issue**: [KTLC-13](https://youtrack.jetbrains.com/issue/KTLC-13)
141+
>
142+
> **Component**: Core language
143+
>
144+
> **Incompatible change type**: behavioral
145+
>
146+
> **Short summary**: Kotlin 2.3 prohibits situations where a reified type parameter is inferred to an intersection type,
147+
> due to the risk of incorrect runtime behavior.
148+
>
149+
> **Deprecation cycle**:
150+
>
151+
> - 2.1.0: report a warning when a reified type parameter is inferred to an intersection type
152+
> - 2.3.0: raise the warning to an error
153+
154+
### Prohibit exposing less-visible types through type parameter bounds
155+
156+
> **Issue**: [KTLC-275](https://youtrack.jetbrains.com/issue/KTLC-275)
157+
>
158+
> **Component**: Core language
159+
>
160+
> **Incompatible change type**: behavioral
161+
>
162+
> **Short summary**: Kotlin 2.3 forbids using type parameter bounds that expose types with more restrictive visibility
163+
> than the function or declaration itself, aligning the rules for functions with those already applied to classes.
164+
>
165+
> **Deprecation cycle**:
166+
>
167+
> - 2.1.0: report a warning on the problematic type parameter bound
168+
> - 2.3.0: raise the warning to an error
169+
170+
### Deprecate misleading Char-to-number conversions and introduce explicit digit and code APIs
43171

44-
> **Issue**: [KTLC-278](https://youtrack.jetbrains.com/issue/KTLC-278)
172+
> **Issue**: [KTLC-321](https://youtrack.jetbrains.com/issue/KTLC-321)
45173
>
46174
> **Component**: Core language
47175
>
48176
> **Incompatible change type**: behavioral
49177
>
50-
> **Short summary**: Lambdas with annotations now use `invokedynamic` through `LambdaMetafactory` by default, aligning their behavior with Java lambdas.
51-
> This affects reflection-based code that relied on retrieving annotations from generated lambda classes.
52-
> To revert to the old behavior, use the `-Xindy-allow-annotated-lambdas=false` compiler option.
178+
> **Short summary**: Kotlin 2.3 deprecates `Char.toX()` and `X.toChar()` conversions for numeric types and introduces new,
179+
> explicit APIs for accessing a character's code and digit value.
53180
>
54181
> **Deprecation cycle**:
55182
>
56-
> - 2.2.0: enable `invokedynamic` for annotated lambdas by default
183+
> - 1.4.30: introduce new functions as Experimental
184+
> - 1.5.0: promote the new functions to Stable; report warnings for old functions with suggestions for replacements
185+
> - 2.3.0: raise the warnings to errors
57186
58187
## Standard library
59188

60189
### Deprecate `String.subSequence(start, end)` function
61190

62-
> **Issue**: [KT-74493](https://youtrack.jetbrains.com/issue/KT-74493)
191+
> **Issue**: [KTLC-282](https://youtrack.jetbrains.com/issue/KTLC-282)
63192
>
64193
> **Component**: kotlin-stdlib
65194
>
@@ -73,7 +202,7 @@ perspective (for example, from Java) is out of the scope of this document.
73202
74203
### Deprecate `kotlin.io.createTempDirectory()` and `kotlin.io.createTempFile()` functions
75204

76-
> **Issue**: [KT-81078](https://youtrack.jetbrains.com/issue/KT-81078)
205+
> **Issue**: [KTLC-281](https://youtrack.jetbrains.com/issue/KTLC-281)
77206
>
78207
> **Component**: kotlin-stdlib
79208
>
@@ -104,7 +233,7 @@ perspective (for example, from Java) is out of the scope of this document.
104233
105234
### Hide `InputStream.readBytes(Int)` function
106235

107-
> **Issue**: [KT-79192](https://youtrack.jetbrains.com/issue/KT-79192)
236+
> **Issue**: [KTLC-280](https://youtrack.jetbrains.com/issue/KTLC-280)
108237
>
109238
> **Component**: kotlin-stdlib
110239
>
@@ -141,8 +270,7 @@ perspective (for example, from Java) is out of the scope of this document.
141270
> **Incompatible change type**: behavioral
142271
>
143272
> **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`,
273+
> receiver element before adding it to the result set. The result set compares elements using `Any::equals`,
146274
> ensuring correct results even when the argument collection uses referential equality (for example, `IdentityHashMap.keys˙).
147275
>
148276
> **Deprecation cycle**:

0 commit comments

Comments
 (0)