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

[SR-231] Function cannot call other functions with the same name #42853

Open
swift-ci opened this issue Dec 14, 2015 · 1 comment
Open

[SR-231] Function cannot call other functions with the same name #42853

swift-ci opened this issue Dec 14, 2015 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-231
Radar None
Original Reporter wczekalski (JIRA User)
Type Bug
Environment

Xcode 8 beta 5 with Swift preview 5
&
Apple Swift version 2.1 (swiftlang-700.1.101.6 clang-700.1.76)
Target: x86_64-apple-darwin15.2.0

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 8b54a0264d94ddd74d8dc7a7f25137a2

Issue Description:

When a function with the same name (not necessarily signature) is called inside other function an error is produced. A very reduced example below produces the following error; Argument passed to call that takes no arguments.

extension String {
    func round() -> CGFloat {
        let a: CGFloat = round(CGFloat(1.0))
        return a
    }
}

The correct behavior would be to call the correct function - round(x: CGFloat in this example.

@swift-ci
Copy link
Collaborator Author

Comment by Maximilian Hünenberger (JIRA)

As of Xcode 8 beta 5 this is still not solved and it occurs with any call to a global function which has the same name (without considering argument labels):

func test(i: Int) {}
class Test {
    func test() {
        test(i: 0)
    }
}

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

1 participant