-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix binary compatibility for inlined local delegated properies
#KT-54650 Fixed
- Loading branch information
Showing
7 changed files
with
72 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
compiler/testData/codegen/bytecodeListing/delegatedProperty/localDelegatedProperty.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This test checks that we use the `...$lambda-0` method name, instead of `...$lambda$0`, for extracted accessors of local delegated properties. | ||
// It's important to keep these names until we fix the binary compatibility issue KT-49030. | ||
|
||
operator fun String.getValue(thisRef: Any?, prop: Any?): String = this | ||
operator fun String.setValue(thisRef: Any?, prop: Any?, value: String) {} | ||
|
||
inline fun foo(): String { | ||
var x by "OK" | ||
return x | ||
} |
20 changes: 20 additions & 0 deletions
20
compiler/testData/codegen/bytecodeListing/delegatedProperty/localDelegatedProperty.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@kotlin.Metadata | ||
public final class LocalDelegatedPropertyKt$foo$x$1 { | ||
// source: 'localDelegatedProperty.kt' | ||
public final static field INSTANCE: kotlin.reflect.KMutableProperty0 | ||
static method <clinit>(): void | ||
method <init>(): void | ||
public method getName(): java.lang.String | ||
public method getOwner(): kotlin.reflect.KDeclarationContainer | ||
public method getSignature(): java.lang.String | ||
} | ||
|
||
@kotlin.Metadata | ||
public final class LocalDelegatedPropertyKt { | ||
// source: 'localDelegatedProperty.kt' | ||
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] | ||
static method <clinit>(): void | ||
public final static @org.jetbrains.annotations.NotNull method foo(): java.lang.String | ||
public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.Nullable p2: java.lang.Object): java.lang.String | ||
public final static method setValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.Nullable p2: java.lang.Object, @org.jetbrains.annotations.NotNull p3: java.lang.String): void | ||
} |
12 changes: 12 additions & 0 deletions
12
compiler/testData/codegen/bytecodeListing/delegatedProperty/localDelegatedProperty_ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@kotlin.Metadata | ||
public final class LocalDelegatedPropertyKt { | ||
// source: 'localDelegatedProperty.kt' | ||
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[] | ||
static method <clinit>(): void | ||
public synthetic final static method access$foo$lambda-0(p0: java.lang.String): java.lang.String | ||
private final static method foo$lambda-0(p0: java.lang.String): java.lang.String | ||
private final static method foo$lambda-1(p0: java.lang.String, p1: java.lang.String): void | ||
public final static @org.jetbrains.annotations.NotNull method foo(): java.lang.String | ||
public final static @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.Nullable p2: java.lang.Object): java.lang.String | ||
public final static method setValue(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.Nullable p1: java.lang.Object, @org.jetbrains.annotations.Nullable p2: java.lang.Object, @org.jetbrains.annotations.NotNull p3: java.lang.String): void | ||
} |
6 changes: 6 additions & 0 deletions
6
...new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeListingTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...w/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeListingTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.