Skip to content
New issue

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

[swift2objc] Support mutating methods #1737

Open
liamappelbe opened this issue Nov 20, 2024 · 1 comment · May be fixed by #1944
Open

[swift2objc] Support mutating methods #1737

liamappelbe opened this issue Nov 20, 2024 · 1 comment · May be fixed by #1944
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) package:swift2objc
Milestone

Comments

@liamappelbe
Copy link
Contributor

struct Point {
  var x: Double
  var y: Double

  mutating func moveBy(x deltaX: Double, y deltaY: Double) {
    x += deltaX
    y += deltaY
  }
}

This came up while I was writing a unit test. These might work without any changes on our end, or we might have to declare the wrapper method as mutating. Need a test for this case either way.

@liamappelbe liamappelbe changed the title [swift2objc] Supper mutating methods [swift2objc] Support mutating methods Nov 20, 2024
@liamappelbe liamappelbe added this to the SwiftGen MVP milestone Nov 27, 2024
@liamappelbe liamappelbe added the good first issue A good starting issue for contributors (issues with this label will appear in /contribute) label Nov 27, 2024
@nikeokoronkwo
Copy link
Contributor

Not much changes were needed, since we can't have mutating functions on classes. The functions can be declared as normal functions in classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) package:swift2objc
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants