Files
kotlin-fork/compiler/fir/analysis-tests/testData/extendedCheckers/RedundantSingleExpressionStringTemplateChecker.txt
T
Mikhail Glukhikh 1c71e64f58 [FIR] Create string interpolating call even for single argument
Before this commit, questionable optimization existed which
unwrapped string interpolating call with single argument to this argument.
However, this led to source element loss and the necessity of sub-hacks.
In this commit we dropped this optimization (anyway user can remove
this single-expression string template in code if needed) to keep
source elements intact.
2020-11-26 08:37:50 +03:00

40 lines
1.8 KiB
Plaintext
Vendored

FILE: RedundantSingleExpressionStringTemplateChecker.kt
public final val x: R|kotlin/String| = String(Hello)
public get(): R|kotlin/String|
public final val y: R|kotlin/String| = <strcat>(R|/x|.R|kotlin/Any.toString|())
public get(): R|kotlin/String|
public final val z: R|kotlin/String| = <strcat>(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 () {
==(this@R|/ProductGroup|.R|/ProductGroup.parent|, Null(null)) -> {
this@R|/ProductGroup|.R|/ProductGroup.short_name|
}
else -> {
<strcat>(this@R|/ProductGroup|.R|/ProductGroup.parent|.R|/ProductGroup.name|.R|kotlin/Any.toString|(), String( ), this@R|/ProductGroup|.R|/ProductGroup.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|
}