[FIR] Add redundant single string expression template checker
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
val x = "Hello"
|
||||
|
||||
val y = "$<!REDUNDANT_SINGLE_EXPRESSION_STRING_TEMPLATE!>x<!>"
|
||||
|
||||
val z = "${y.hashCode()}"
|
||||
|
||||
fun toString(x: String) = "IC$x"
|
||||
|
||||
data class ProductGroup(val short_name: String, val parent: ProductGroup?) {
|
||||
val name: String = if (parent == null) short_name else "${parent.name} $short_name"
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
FILE: RedundantSingleExpressionStringTemplateChecker.kt
|
||||
public final val x: R|kotlin/String| = String(Hello)
|
||||
public get(): R|kotlin/String|
|
||||
public final val y: R|kotlin/String| = R|/x|.R|kotlin/Any.toString|()
|
||||
public get(): R|kotlin/String|
|
||||
public final val z: R|kotlin/String| = R|/y|.R|kotlin/Any.hashCode|().R|kotlin/Any.toString|()
|
||||
public get(): R|kotlin/String|
|
||||
public final fun toString(x: R|kotlin/String|): R|kotlin/String| {
|
||||
^toString <strcat>(String(IC), R|<local>/x|.R|kotlin/Any.toString|())
|
||||
}
|
||||
public final data class ProductGroup : R|kotlin/Any| {
|
||||
public constructor(short_name: R|kotlin/String|, parent: R|ProductGroup?|): R|ProductGroup| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val short_name: R|kotlin/String| = R|<local>/short_name|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final val parent: R|ProductGroup?| = R|<local>/parent|
|
||||
public get(): R|ProductGroup?|
|
||||
|
||||
public final val name: R|kotlin/String| = when () {
|
||||
==(R|<local>/parent|, Null(null)) -> {
|
||||
R|<local>/short_name|
|
||||
}
|
||||
else -> {
|
||||
<strcat>(R|<local>/parent|.R|/ProductGroup.name|.R|kotlin/Any.toString|(), String( ), R|<local>/short_name|.R|kotlin/Any.toString|())
|
||||
}
|
||||
}
|
||||
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final fun component1(): R|kotlin/String|
|
||||
|
||||
public final fun component2(): R|ProductGroup?|
|
||||
|
||||
public final fun copy(short_name: R|kotlin/String| = this@R|/ProductGroup|.R|/ProductGroup.short_name|, parent: R|ProductGroup?| = this@R|/ProductGroup|.R|/ProductGroup.parent|): R|ProductGroup|
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user