-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Compatibility guide for Kotlin 2.1.0 #4540
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two minor issues with core language <-> stdlib changes, but the rest is good, thank you
> - 2.1.0: report a warning | ||
> - 2.2.0: raise the warning to an error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> - 2.1.0: report a warning | |
> - 2.2.0: raise the warning to an error | |
> - 2.1.0: start throwing an exception when a map structural modification is detected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you - I updated it (removed the start from the beginning)
- 2.1.0: throw an exception when a map structural modification is detected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! Left some suggestions, please take a look.
[//]: # (title: Compatibility guide for Kotlin 2.1) | ||
|
||
_[Keeping the Language Modern](kotlin-evolution-principles.md)_ and _[Comfortable Updates](kotlin-evolution-principles.md)_ are among the fundamental principles in | ||
Kotlin Language Design. The former says that constructs which obstruct language evolution should be removed, and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this part is fixed from previous guide versions, but, to make it more conversational and closer to users, could we change "The former and the latter", for:
"The first principle states that constructs which obstruct language evolution should be removed, while the second principle emphasizes that such removal should be well-communicated..."
or something like this?
|
||
In this document we introduce several kinds of compatibility: | ||
|
||
- _source_: source-incompatible change stops code that used to compile fine (without errors or warnings) from compiling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we bold the terms? For consistency with this type of list in our docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one last thing:
"## Changes in K2 smart cast propagation"
Is the only one header that doesn't start with a verb. Should we change it for consistency?
@@ -0,0 +1,479 @@ | |||
[//]: # (title: Compatibility guide for Kotlin 2.1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A related question: would it be possible to link the compatibility guide from the What's new page? (as we did in 1.9 and before)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ilya - I asked the team - we'll link to it! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standard library section looks good! Just a few minor suggestions.
> | ||
> - 1.4.30: introduce locale-agnostic alternatives as experimental API | ||
> - 1.5.0: deprecate locale-sensitive case conversion functions with a warning | ||
> - 2.1.0: raise the warning to an error` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> - 2.1.0: raise the warning to an error` | |
> - 2.1.0: raise the warning to an error |
> **Incompatible change type**: source | ||
> | ||
> **Short summary**: Freezing-related APIs in Kotlin/Native, previously marked with the `@FreezingIsDeprecated` annotation, are now deprecated. | ||
> This aligns with the new memory manager that removes the need for freezing objects for thread sharing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> This aligns with the new memory manager that removes the need for freezing objects for thread sharing. | |
> This aligns with the introduction of the new memory manager that removes the need for freezing objects for thread sharing. |
> | ||
> **Incompatible change type**: behavioral | ||
> | ||
> **Short summary**: K2 changes the behavior of smart cast propagation by introducing bidirectional propagation of type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> **Short summary**: K2 changes the behavior of smart cast propagation by introducing bidirectional propagation of type | |
> **Short summary**: The K2 compiler changes its behavior for smart cast propagation by introducing bidirectional propagation of type |
> | ||
> - 1.4.30: introduce locale-agnostic alternatives as experimental API | ||
> - 1.5.0: deprecate locale-sensitive case conversion functions with a warning | ||
> - 2.1.0: raise the warning to an error` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> - 2.1.0: raise the warning to an error` | |
> - 2.1.0: raise the warning to an error |
> | ||
> - 2.1.0: deprecate and remove `kotlin-stdlib-common.jar` artifact | ||
|
||
### Deprecate appendln in favor of appendLine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Deprecate appendln in favor of appendLine | |
### Deprecate appendln() in favor of appendLine() |
> | ||
> **Short summary**: Exposing types with lower visibility through type parameter bounds is now prohibited, | ||
> addressing inconsistencies in type visibility rules. | ||
> This change ensures that bounds on type parameters follow the same visibility rules as classes, preventing issues like IR validation errors in JVM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> This change ensures that bounds on type parameters follow the same visibility rules as classes, preventing issues like IR validation errors in JVM. | |
> This change ensures that bounds on type parameters follow the same visibility rules as classes, preventing issues like IR validation errors in the JVM. |
> | ||
> **Short summary**: The `registerKotlinJvmCompileTask(taskName, moduleName)` function is deprecated | ||
> in favor of the new `registerKotlinJvmCompileTask(taskName, compilerOptions, explicitApiMode)` function, which now accepts `KotlinJvmCompilerOptions`. | ||
> This allows you to pass a `compilerOptions` instance, typically from an extension or target, with values used as conventions for the task’s options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> This allows you to pass a `compilerOptions` instance, typically from an extension or target, with values used as conventions for the task’s options. | |
> This allows you to pass a `compilerOptions` instance, typically from an extension or target, with values used as conventions for the task's options. |
> | ||
> **Incompatible change type**: source | ||
> | ||
> **Short summary**: support for these platform plugin IDs have been removed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> **Short summary**: support for these platform plugin IDs have been removed: | |
> **Short summary**: Support for these platform plugin IDs have been removed: |
Compatibility guide for Kotlin 2.1