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

[Swift Language Features] Resolve name conflicts between methods and properties #2997

Open
Tracked by #2843
jkurdek opened this issue Feb 12, 2025 · 0 comments
Open
Tracked by #2843
Assignees
Labels
area-SwiftBindings Swift bindings for .NET

Comments

@jkurdek
Copy link
Member

jkurdek commented Feb 12, 2025

In Swift methods arguments are part of the methods name, so we can have:

public func foo(a :Int32) -> Int32 {
    return a
}
public func foo(b :Int32) -> Int32 {
    return b
}
public func foo(_: Int32) -> Int32 {
   return 3
}

We can also have a property of the same name:

public let foo: Int32 = 0

All above the can coexist within the same scope without conflicts. C# does not allow for such flexibility so we will need to introduce some method to resolve such conflicts.

One way might be to append argument names to the function

@jkurdek jkurdek added the area-SwiftBindings Swift bindings for .NET label Feb 12, 2025
@kotlarmilos kotlarmilos added the User Story A single user-facing feature. Can be grouped under an epic. label Feb 13, 2025
@kotlarmilos kotlarmilos self-assigned this Feb 13, 2025
@kotlarmilos kotlarmilos removed the User Story A single user-facing feature. Can be grouped under an epic. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-SwiftBindings Swift bindings for .NET
Projects
None yet
Development

No branches or pull requests

2 participants