java static final in kotlin: Const 'val' initializer should be a constant value : <p>In Java, We can do this:</p>

<pre><code>public class TestA {
    public static final boolean flag = true;
    public static final String str = flag ? "A" : "B"; // ok
}
</code></pre>

<p>But cannot in Kotlin</p>

<pre><code> class TestA {
    companion object {
        const val flag = true
        const val str = if (flag) "A" else "B" //err: Const 'val' initializer should be a constant value

        val str2 = if (flag) "A" else "B" //ok, but not equals [public static final] in Java.
    }
}
</code></pre>

<p>Tried <strong>@JvmStatic</strong> on non-const <strong>str2</strong>, but decompiled to java code, it's</p>

<pre><code>private static final String str2 = "A"
public static final String getStr2() {
      return Companion.getStr2();
   }
</code></pre>

<p>Problem: kotlin <strong>if-else</strong> equals <strong>?:</strong> in java,but cannnot use for <strong>const</strong> val. need solution for this.</p>
