Thread
#language-evolution
    christophsturm

    christophsturm

    1 year ago
    this seems to be better suited for here.
    uli

    uli

    1 year ago
    like in swift, where enum values are resolved against the infered type:
    let myEnum: MyEnum = .myEnumValue
    christophsturm

    christophsturm

    1 year ago
    or in ruby
    ["abC","cdE"].map(&:downcase)
    but thats more related to
    listOf("aaa", "bbb").map(String::toLowerCase)
    where
    String
    can also be infered.
    elizarov

    elizarov

    1 year ago
    In Kotlin
    ::id
    is a reference to a top-level function named
    id
    without a receiver. For resolving against the inferred type there's a separate issue: KT-16768 Context-sensitive resolution (Resolve unqualified enum constants based on expected type)
    uli

    uli

    1 year ago
    You are certainly right
    christophsturm

    christophsturm

    1 year ago
    it would be really great if there was a short form for methods or fields of a known class.