vinivendra / Gryphon

The Swift to Kotlin translator.
https://vinivendra.github.io/Gryphon/
Other
607 stars 46 forks source link

Support single expression members #80

Closed sgade closed 4 years ago

sgade commented 4 years ago

What's in this pull request?

Adds support for single-expression members (on classes and structs). This is part 2, following #75.

Example:

class SingleExpressionMembers {
    var one: Int {
        10
    }

    var two: Int {
        get {
            20
        }
    }
}
internal open class SingleExpressionMembers {
    open val one: Int
        get() = 10
    open val two: Int
        get() = 20
}

Does this resolve an open issue?

Yeah, it resolves #72.

Checklist for submitting a pull request:

vinivendra commented 4 years ago

Ok, the release is ready, just waiting for this. Let me know if you'll have time to add the test now, otherwise I'll merge the PR and we can add it later.

vinivendra commented 4 years ago

Alright, I'm merging it (sorry, I'm kind of in a hurry here). Great job and thanks again :)