Mark synthesized box/unbox methods in inline classes as ACC_SYNTHETIC
This commit is contained in:
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.name.FqName;
|
|||||||
import org.jetbrains.kotlin.protobuf.MessageLite;
|
import org.jetbrains.kotlin.protobuf.MessageLite;
|
||||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer;
|
import org.jetbrains.kotlin.renderer.DescriptorRenderer;
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||||
|
import org.jetbrains.kotlin.resolve.InlineClassDescriptorResolver;
|
||||||
import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt;
|
import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt;
|
||||||
import org.jetbrains.kotlin.resolve.checkers.ExpectedActualDeclarationChecker;
|
import org.jetbrains.kotlin.resolve.checkers.ExpectedActualDeclarationChecker;
|
||||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
|
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
|
||||||
@@ -255,7 +256,9 @@ public class AsmUtil {
|
|||||||
|
|
||||||
if (KotlinTypeMapper.isAccessor(functionDescriptor) ||
|
if (KotlinTypeMapper.isAccessor(functionDescriptor) ||
|
||||||
hasJvmSyntheticAnnotation(functionDescriptor) ||
|
hasJvmSyntheticAnnotation(functionDescriptor) ||
|
||||||
isInlineClassWrapperConstructor(functionDescriptor, kind)
|
isInlineClassWrapperConstructor(functionDescriptor, kind) ||
|
||||||
|
InlineClassDescriptorResolver.isSynthesizedBoxMethod(functionDescriptor) ||
|
||||||
|
InlineClassDescriptorResolver.isSynthesizedUnboxMethod(functionDescriptor)
|
||||||
) {
|
) {
|
||||||
flags |= ACC_SYNTHETIC;
|
flags |= ACC_SYNTHETIC;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -14,7 +14,7 @@ public final class Foo {
|
|||||||
inner class Foo$Companion
|
inner class Foo$Companion
|
||||||
static method <clinit>(): void
|
static method <clinit>(): void
|
||||||
private synthetic method <init>(p0: int): void
|
private synthetic method <init>(p0: int): void
|
||||||
public final static @org.jetbrains.annotations.NotNull method box(p0: int): Foo
|
public synthetic final static @org.jetbrains.annotations.NotNull method box(p0: int): Foo
|
||||||
public static method constructor(p0: int): int
|
public static method constructor(p0: int): int
|
||||||
public static method equals(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
public static method equals(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
||||||
public method equals(p0: java.lang.Object): boolean
|
public method equals(p0: java.lang.Object): boolean
|
||||||
@@ -24,5 +24,5 @@ public final class Foo {
|
|||||||
public final static method inInlineClass(p0: int): void
|
public final static method inInlineClass(p0: int): void
|
||||||
public method toString(): java.lang.String
|
public method toString(): java.lang.String
|
||||||
public static @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
public static @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
||||||
public final method unbox(): int
|
public synthetic final method unbox(): int
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
public final class Foo {
|
public final class Foo {
|
||||||
private final field x: int
|
private final field x: int
|
||||||
private synthetic method <init>(p0: int): void
|
private synthetic method <init>(p0: int): void
|
||||||
public final static @org.jetbrains.annotations.NotNull method box(p0: int): Foo
|
public synthetic final static @org.jetbrains.annotations.NotNull method box(p0: int): Foo
|
||||||
public static method constructor(p0: int): int
|
public static method constructor(p0: int): int
|
||||||
public static method equals(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
public static method equals(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
||||||
public method equals(p0: java.lang.Object): boolean
|
public method equals(p0: java.lang.Object): boolean
|
||||||
@@ -14,5 +14,5 @@ public final class Foo {
|
|||||||
public static method hashCode(p0: int): int
|
public static method hashCode(p0: int): int
|
||||||
public method toString(): java.lang.String
|
public method toString(): java.lang.String
|
||||||
public static @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
public static @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
||||||
public final method unbox(): int
|
public synthetic final method unbox(): int
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
public final class Foo {
|
public final class Foo {
|
||||||
private final field x: int
|
private final field x: int
|
||||||
private synthetic method <init>(p0: int): void
|
private synthetic method <init>(p0: int): void
|
||||||
public final static @org.jetbrains.annotations.NotNull method box(p0: int): Foo
|
public synthetic final static @org.jetbrains.annotations.NotNull method box(p0: int): Foo
|
||||||
public static method constructor(p0: int): int
|
public static method constructor(p0: int): int
|
||||||
public static method constructor(p0: int, p1: int): int
|
public static method constructor(p0: int, p1: int): int
|
||||||
public static method constructor(p0: long): int
|
public static method constructor(p0: long): int
|
||||||
@@ -15,5 +15,5 @@ public final class Foo {
|
|||||||
public static method hashCode(p0: int): int
|
public static method hashCode(p0: int): int
|
||||||
public method toString(): java.lang.String
|
public method toString(): java.lang.String
|
||||||
public static @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
public static @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
||||||
public final method unbox(): int
|
public synthetic final method unbox(): int
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -49,7 +49,7 @@ public interface IFoo {
|
|||||||
public final class Z {
|
public final class Z {
|
||||||
private final field x: int
|
private final field x: int
|
||||||
private synthetic method <init>(p0: int): void
|
private synthetic method <init>(p0: int): void
|
||||||
public final static @org.jetbrains.annotations.NotNull method box(p0: int): Z
|
public synthetic final static @org.jetbrains.annotations.NotNull method box(p0: int): Z
|
||||||
public static method constructor(p0: int): int
|
public static method constructor(p0: int): int
|
||||||
public static method constructor(p0: long): int
|
public static method constructor(p0: long): int
|
||||||
public static method equals(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
public static method equals(p0: int, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
||||||
@@ -91,5 +91,5 @@ public final class Z {
|
|||||||
public static @ASet method setOverridingVar(p0: int, @ASetParam p1: int): void
|
public static @ASet method setOverridingVar(p0: int, @ASetParam p1: int): void
|
||||||
public @A @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
public @A @org.jetbrains.annotations.NotNull method toString(): java.lang.String
|
||||||
public static @A @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
public static @A @org.jetbrains.annotations.NotNull method toString(p0: int): java.lang.String
|
||||||
public final method unbox(): int
|
public synthetic final method unbox(): int
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@ public interface A {
|
|||||||
public final class Foo {
|
public final class Foo {
|
||||||
private final field x: long
|
private final field x: long
|
||||||
private synthetic method <init>(p0: long): void
|
private synthetic method <init>(p0: long): void
|
||||||
public final static @org.jetbrains.annotations.NotNull method box(p0: long): Foo
|
public synthetic final static @org.jetbrains.annotations.NotNull method box(p0: long): Foo
|
||||||
public static method constructor(p0: long): long
|
public static method constructor(p0: long): long
|
||||||
public method equals(p0: java.lang.Object): boolean
|
public method equals(p0: java.lang.Object): boolean
|
||||||
public static method equals(p0: long, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
public static method equals(p0: long, @org.jetbrains.annotations.Nullable p1: java.lang.Object): boolean
|
||||||
@@ -19,5 +19,5 @@ public final class Foo {
|
|||||||
public static method hashCode(p0: long): int
|
public static method hashCode(p0: long): int
|
||||||
public method toString(): java.lang.String
|
public method toString(): java.lang.String
|
||||||
public static @org.jetbrains.annotations.NotNull method toString(p0: long): java.lang.String
|
public static @org.jetbrains.annotations.NotNull method toString(p0: long): java.lang.String
|
||||||
public final method unbox(): long
|
public synthetic final method unbox(): long
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
public final class Foo {
|
public final class Foo {
|
||||||
private final field l: long
|
private final field l: long
|
||||||
private synthetic method <init>(p0: long): void
|
private synthetic method <init>(p0: long): void
|
||||||
public final static @org.jetbrains.annotations.NotNull method box(p0: long): Foo
|
public synthetic final static @org.jetbrains.annotations.NotNull method box(p0: long): Foo
|
||||||
public static method constructor(p0: long): long
|
public static method constructor(p0: long): long
|
||||||
public final static method empty(p0: long): void
|
public final static method empty(p0: long): void
|
||||||
public method equals(p0: java.lang.Object): boolean
|
public method equals(p0: java.lang.Object): boolean
|
||||||
@@ -15,5 +15,5 @@ public final class Foo {
|
|||||||
public final static method param(p0: long, p1: double): void
|
public final static method param(p0: long, p1: double): void
|
||||||
public method toString(): java.lang.String
|
public method toString(): java.lang.String
|
||||||
public static @org.jetbrains.annotations.NotNull method toString(p0: long): java.lang.String
|
public static @org.jetbrains.annotations.NotNull method toString(p0: long): java.lang.String
|
||||||
public final method unbox(): long
|
public synthetic final method unbox(): long
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -7,5 +7,5 @@ fun test(zs: MutableList<Z2>, z: Z2) {
|
|||||||
zs.add(z)
|
zs.add(z)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1 public final static box\(I\)LZ2;
|
// 1 public final static synthetic box\(I\)LZ2;
|
||||||
// 1 INVOKESTATIC Z2\.box \(I\)LZ2;
|
// 1 INVOKESTATIC Z2\.box \(I\)LZ2;
|
||||||
Reference in New Issue
Block a user