We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When translating structs into dataclasses, the current translators converts this:
struct Rect { var origin = Point() var size = Size() var center: Point { get { let centerX = origin.x + (size.width / 2) let centerY = origin.y + (size.height / 2) return Point(x: centerX, y: centerY) } set(newCenter) { origin.x = newCenter.x - (size.width / 2) origin.y = newCenter.y - (size.height / 2) } } }
into:
data class Rect( var origin = Point(), var size = Size(), var center: Point get() { val centerX = origin.x + (size.width / 2) val centerY = origin.y + (size.height / 2) return Point(x = centerX, y = centerY) } set(newCenter) { origin.x = newCenter.x - (size.width / 2) origin.y = newCenter.y - (size.height / 2) }) {}
The first 2 properties are properly placed into the constructor, but the computed one should be kept out of it, like:
data class Rect( var origin = Point(), var size = Size()) { var center: Point get() { val centerX = origin.x + (size.width / 2) val centerY = origin.y + (size.height / 2) return Point(x = centerX, y = centerY) } set(newCenter) { origin.x = newCenter.x - (size.width / 2) origin.y = newCenter.y - (size.height / 2) } }
The text was updated successfully, but these errors were encountered:
Fixed with b60576f
Sorry, something went wrong.
#70 Fixed issue with computed properties on structs
b60576f
No branches or pull requests
When translating structs into dataclasses, the current translators converts this:
into:
The first 2 properties are properly placed into the constructor, but the computed one should be kept out of it, like:
The text was updated successfully, but these errors were encountered: