Transform Enum.values to property

This commit is contained in:
Denis Zharkov
2015-10-16 14:20:19 +03:00
parent d985f56b8d
commit d8ede6d03e
17 changed files with 140 additions and 29 deletions
+3 -1
View File
@@ -315,8 +315,10 @@ public final enum class DeprecationLevel : kotlin.Enum<kotlin.DeprecationLevel>
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: kotlin.DeprecationLevel): kotlin.Int
// Static members
public final /*synthesized*/ val values: kotlin.Array<kotlin.DeprecationLevel>
public final fun <get-values>(): kotlin.Array<kotlin.DeprecationLevel>
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): kotlin.DeprecationLevel
public final /*synthesized*/ fun values(): kotlin.Array<kotlin.DeprecationLevel>
@kotlin.Deprecated(message = "Use 'values' property instead", replaceWith = kotlin.ReplaceWith(expression = "this.values", imports = {})) public final /*synthesized*/ fun values(): kotlin.Array<kotlin.DeprecationLevel>
}
public final class Double : kotlin.Number, kotlin.Comparable<kotlin.Double> {
@@ -4,7 +4,7 @@ enum class E {
private companion object
}
fun foo() = E.values()
fun foo() = E.values
fun bar() = E.valueOf("ENTRY")
fun baz() = E.ENTRY
fun <!EXPOSED_FUNCTION_RETURN_TYPE!>quux<!>() = <!INVISIBLE_MEMBER!>E<!>
@@ -7,5 +7,5 @@ public enum A {
// FILE: test.kt
fun main() {
checkSubtype<Array<A>>(A.values())
checkSubtype<Array<A>>(A.values)
}
@@ -21,4 +21,4 @@ fun f1() = ENTRY
fun f2() = ANOTHER
fun f3() = Nested()
fun f4() = Nested.foo()
fun f5() = values()
fun f5() = values
@@ -3,16 +3,16 @@ enum class E {
companion object {
fun foo(): E = ENTRY
fun bar(): Array<E> = values()
fun bar(): Array<E> = values
fun baz(): E = valueOf("ENTRY")
val valuez = values()
val valuez = values
}
fun oof(): E = ENTRY
fun rab(): Array<E> = values()
fun rab(): Array<E> = values
fun zab(): E = valueOf("ENTRY")
}
fun foo() = E.ENTRY
fun bar() = E.values()
fun bar() = E.values
fun baz() = E.valueOf("ENTRY")