How has Kotlin/Native 1.5.20 improved compiler bug fixes?

Share

Kotlin 1.5.20

Kotlin continues to stay up to date and updates and fixes the issues in Kotlin 1.5.0. Kotlin 1.5.20 has been released, and makes improvements in Java features and support.

The following are some of the updates and fixes in Kotlin 1.5.20.

  • Kotlin/JVM improvements.

  • Kotlin/Native improvements.

  • Kotlin/JS IR backend migration guide.

  • Gradle improvements. Standard library improvements.

Improvements in Kotlin/Native

A lot of significant changes have been made in Kotlin 1.5.20. However, an essential bug fix is made that affects compatibility.

In the previous versions of Kotlin, the string constants with the incorrect UTFUnicode Transformation Format surrogate pairs lacked their values during compilation. In this version, such values are preserved.

It is safe for app developers to update to 1.5.20. However, libraries compiled with 1.5.20 are not compatible with previous compiler versions of Kotlin.

Changelog updates in Kotlin 1.5.20

The following is the list of changes and updates related to Kotlin/Native 1.5.20.

Compiler

1. New features

New features introduced to the Kotlin/Native 1.5.20 Compiler are:

  • No error in Java generic class. With the nullable type argument in Kotlin, the @NotNull type parameter is utilized.

  • Support error/warning suppression.

  • Support nullability annotations at the module level.

  • No warnings based on jspecify annotations.

  • Allow JvmInline annotation to be omitted for expected value classes.

  • For -jvm-target 1.8 and above, does not declare footnotes on function type parameters into bytecode.

2. Performance improvements

  • Don’t box primitive values inequality comparison with objects in JVM_IR.

3. Fixes

Some of the fixes related to the Kotlin/Native 1.5.20 Compiler are listed below.

  • Unresolved annotation should be an error.
  • Type annotation remained unsolved in an unknown object expression on a type parameter of a supertype.
  • Restrain the use of a type parameter associated with an extension property within a delegate.

  • Interpretation of annotation on return types and supertypes is not made.

  • Annotation mark is not interpreted in some instances for type annotations.

  • Prevent unsafe calls with expected @NotNull T and presented Kotlin generic parameter including nullable bound.

  • For Kotlin/Native IR: Remapping of reference to expect characteristics in the actual declaration is not done.

  • Kotlin/Native: In general, the IR backend module’s IrProperty.overridden symbols still can’t be used, as it does not function fully in Native.

  • Native: When Int.MIN_VALUE is divided by -1, it either hangs or crashes.

IDE - Native

  • Reduced memory consumption

1. Native. C Export

  • Error can occur when packages without public methods produce an empty struct in the header.

2. Native. ObjC Export

  • kdoc comments are not a part of Kotlin MP iOS Target.

  • KMM: hard to pass an error to Kotlin code from implementing Kotlin method in Swift code.

3. Native. Runtime. Memory

  • Profiling shows that when KMP code is operated, a lot of time is consumed on updateHeapRef on Apple platforms.

4. Tools. Gradle. Native.

  • In MPP Gradle plugin, a framework packing task for Kotlin/Native is presented.

  • When the download process is stopped, stdlib is missing.

For a detailed list of changes and working, visit the changelog.