Skip to content

Commit d94b73d

Browse files
committed
Fix incorrect inline treatments
Also whoops classes never had `inline` (they've had `value` this whole time)
1 parent a0d84ad commit d94b73d

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

plugins/kotlin/src/main/java/org/vineflower/kotlin/KotlinWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,8 @@ private void writeClassDefinition(ClassNode node, TextBuffer buffer, int indent,
766766
if (IS_FUN_INTERFACE.get(kotlinFlags)) {
767767
buffer.append("fun ");
768768
}
769-
if (IS_INLINE.get(kotlinFlags)) {
770-
buffer.append("inline ");
769+
if (IS_VALUE_CLASS.get(kotlinFlags)) {
770+
buffer.append("value ");
771771
}
772772
if (IS_DATA.get(kotlinFlags)) {
773773
buffer.append("data ");

plugins/kotlin/src/main/java/org/vineflower/kotlin/struct/KProperty.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public TextBuffer stringify(int indent) {
130130
buf.append("external ");
131131
}
132132

133-
if (IS_INLINE.get(getter.flags())) {
133+
if (IS_INLINE_ACCESSOR.get(getter.flags())) {
134134
buf.append("inline ");
135135
}
136136

plugins/kotlin/src/main/java/org/vineflower/kotlin/util/KUtils.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,17 @@ public static Exprent replaceExprent(Exprent ex) {
4848

4949
public static void appendVisibility(TextBuffer buf, ProtoBuf.Visibility visibility) {
5050
switch (visibility) {
51-
case LOCAL:
52-
buf.append("// QF: local property")
53-
.appendLineSeparator()
54-
.append("internal ");
55-
break;
56-
case PRIVATE_TO_THIS:
57-
buf.append("private ");
58-
break;
59-
case PUBLIC:
51+
case LOCAL -> buf.append("// $VF: local visibility outside of method")
52+
.appendLineSeparator()
53+
.append("internal ");
54+
case PRIVATE_TO_THIS -> buf.append("private ");
55+
case PUBLIC -> {
6056
if (DecompilerContext.getOption(KotlinOptions.SHOW_PUBLIC_VISIBILITY)) {
6157
buf.append("public ");
6258
}
63-
break;
64-
default:
65-
buf.append(visibility.name().toLowerCase())
66-
.append(' ');
59+
}
60+
default -> buf.append(visibility.name().toLowerCase())
61+
.append(' ');
6762
}
6863
}
6964

0 commit comments

Comments
 (0)