[FIR] Mark value classes as inline in raw fir building
This commit is contained in:
committed by
teamcityserver
parent
8df56af068
commit
4deb935f76
+1
-1
@@ -1,5 +1,5 @@
|
||||
FILE: inlineClassConstructor.kt
|
||||
public final class WithoutConstructor : R|kotlin/Any| {
|
||||
public final inline class WithoutConstructor : R|kotlin/Any| {
|
||||
public constructor(): R|WithoutConstructor| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ FILE: inlineClassDeclaration.kt
|
||||
|
||||
}
|
||||
|
||||
public final inner class D : R|kotlin/Any| {
|
||||
public final inner inline class D : R|kotlin/Any| {
|
||||
public constructor(x: R|kotlin/Int|): R|A.D| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
@@ -65,7 +65,7 @@ FILE: inlineClassDeclaration.kt
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public final class CloneableClass1 : R|kotlin/Cloneable| {
|
||||
public final inline class CloneableClass1 : R|kotlin/Cloneable| {
|
||||
public constructor(x: R|kotlin/Int|): R|CloneableClass1| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
FILE: inlineClassMembers.kt
|
||||
public final class BackingFields : R|kotlin/Any| {
|
||||
public final inline class BackingFields : R|kotlin/Any| {
|
||||
public constructor(x: R|kotlin/Int|): R|BackingFields| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
@@ -82,7 +82,7 @@ FILE: inlineClassMembers.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final class WithInner : R|kotlin/Any| {
|
||||
public final inline class WithInner : R|kotlin/Any| {
|
||||
public constructor(x: R|kotlin/String|): R|WithInner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ open class Modifier(var modifiers: Long = ModifierFlag.NONE.value) {
|
||||
setFlag(ModifierFlag.PROPERTY_CONST)
|
||||
setFlag(ModifierFlag.PARAMETER_CONST)
|
||||
}
|
||||
KtTokens.INLINE_KEYWORD -> {
|
||||
KtTokens.INLINE_KEYWORD, KtTokens.VALUE_KEYWORD -> {
|
||||
setFlag(if (isInClass) ModifierFlag.CLASS_INLINE else ModifierFlag.FUNCTION_INLINE)
|
||||
}
|
||||
else -> {
|
||||
|
||||
@@ -866,7 +866,7 @@ open class RawFirBuilder(
|
||||
isInner = classOrObject.hasModifier(INNER_KEYWORD)
|
||||
isCompanion = (classOrObject as? KtObjectDeclaration)?.isCompanion() == true
|
||||
isData = classOrObject.hasModifier(DATA_KEYWORD)
|
||||
isInline = classOrObject.hasModifier(INLINE_KEYWORD)
|
||||
isInline = classOrObject.hasModifier(INLINE_KEYWORD) || classOrObject.hasModifier(VALUE_KEYWORD)
|
||||
isFun = classOrObject.hasModifier(FUN_KEYWORD)
|
||||
isExternal = classOrObject.hasModifier(EXTERNAL_KEYWORD)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_REFLECT
|
||||
// FILE: box.kt
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// IGNORE_BACKEND: WASM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
|
||||
+2
-2
@@ -14,11 +14,11 @@ value class Bar(val y: String)
|
||||
fun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {
|
||||
val a1 = f1 === f2 || f1 !== f2
|
||||
val a2 = f1 === f1
|
||||
val a3 = <!EQUALITY_NOT_APPLICABLE_WARNING!>f1 === b1<!> || <!EQUALITY_NOT_APPLICABLE_WARNING!>f1 !== b1<!>
|
||||
val a3 = <!EQUALITY_NOT_APPLICABLE!>f1 === b1<!> || <!EQUALITY_NOT_APPLICABLE!>f1 !== b1<!>
|
||||
|
||||
val c1 = fn1 === fn2 || fn1 !== fn2
|
||||
val c2 = f1 === fn1 || f1 !== fn1
|
||||
val c3 = <!EQUALITY_NOT_APPLICABLE_WARNING!>b1 === fn1<!> || <!EQUALITY_NOT_APPLICABLE_WARNING!>b1 !== fn1<!>
|
||||
val c3 = <!EQUALITY_NOT_APPLICABLE!>b1 === fn1<!> || <!EQUALITY_NOT_APPLICABLE!>b1 !== fn1<!>
|
||||
|
||||
val any = Any()
|
||||
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// !SKIP_JAVAC
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
package kotlin.jvm
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation class JvmInline
|
||||
|
||||
@JvmInline
|
||||
value class MyInt(val x: Int)
|
||||
@JvmInline
|
||||
value class MyString(val x: String)
|
||||
|
||||
annotation class Ann1(val a: <!INVALID_TYPE_OF_ANNOTATION_MEMBER!>MyInt<!>)
|
||||
annotation class Ann2(val a: <!INVALID_TYPE_OF_ANNOTATION_MEMBER!>Array<MyString><!>)
|
||||
annotation class Ann3(vararg val a: <!INVALID_TYPE_OF_ANNOTATION_MEMBER!>MyInt<!>)
|
||||
|
||||
annotation class Ann4(val a: KClass<MyInt>)
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !SKIP_JAVAC
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
|
||||
Vendored
+7
-7
@@ -9,19 +9,19 @@ annotation class JvmInline
|
||||
@JvmInline
|
||||
value class Foo(val x: Int)
|
||||
|
||||
fun f1(vararg a: Foo) {}
|
||||
fun f2(vararg a: Foo?) {}
|
||||
fun f1(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> a: Foo) {}
|
||||
fun f2(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> a: Foo?) {}
|
||||
|
||||
class A {
|
||||
fun f3(a0: Int, vararg a1: Foo) {
|
||||
fun f4(vararg a: Foo) {}
|
||||
fun f3(a0: Int, <!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> a1: Foo) {
|
||||
fun f4(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> a: Foo) {}
|
||||
|
||||
val g = fun (<!USELESS_VARARG_ON_PARAMETER!>vararg v: Foo<!>) {}
|
||||
}
|
||||
}
|
||||
|
||||
class B(vararg val s: Foo) {
|
||||
constructor(a: Int, vararg s: Foo) : this(*s)
|
||||
class B(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> val s: Foo) {
|
||||
constructor(a: Int, <!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> s: Foo) : this(*s)
|
||||
}
|
||||
|
||||
annotation class Ann(vararg val f: <!INVALID_TYPE_OF_ANNOTATION_MEMBER!>Foo<!>)
|
||||
annotation class Ann(<!FORBIDDEN_VARARG_PARAMETER_TYPE!>vararg<!> val f: <!INVALID_TYPE_OF_ANNOTATION_MEMBER!>Foo<!>)
|
||||
|
||||
Reference in New Issue
Block a user