Stdlib rename: 'name' and 'ordinal' are now properties in Enum, same name functions are deprecated
This commit is contained in:
@@ -27,13 +27,13 @@ public abstract class Enum<E : Enum<E>>(name: String, ordinal: Int): Comparable<
|
||||
/**
|
||||
* Returns the name of this enum constant, exactly as declared in its enum declaration.
|
||||
*/
|
||||
public final fun name(): String
|
||||
public final val name: String
|
||||
|
||||
/**
|
||||
* Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant
|
||||
* is assigned an ordinal of zero).
|
||||
*/
|
||||
public final fun ordinal(): Int
|
||||
public final val ordinal: Int
|
||||
|
||||
public override final fun compareTo(other: E): Int
|
||||
|
||||
|
||||
+2
@@ -33,6 +33,8 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
|
||||
|
||||
object BuiltinSpecialProperties {
|
||||
private val PROPERTY_FQ_NAME_TO_JVM_GETTER_NAME_MAP = mapOf(
|
||||
FqName("kotlin.Enum.name") to Name.identifier("name"),
|
||||
FqName("kotlin.Enum.ordinal") to Name.identifier("ordinal"),
|
||||
FqName("kotlin.Collection.size") to Name.identifier("size"),
|
||||
FqName("kotlin.Map.size") to Name.identifier("size"),
|
||||
FqName("kotlin.CharSequence.length") to Name.identifier("length"),
|
||||
|
||||
Reference in New Issue
Block a user