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

Override with Wrong Argument Label? #1009

Closed
Redoubts opened this issue May 5, 2016 · 2 comments
Closed

Override with Wrong Argument Label? #1009

Redoubts opened this issue May 5, 2016 · 2 comments

Comments

@Redoubts
Copy link

Redoubts commented May 5, 2016

I have a question about Classes/Highlight/HorizontalBarChartHighlighter.swift

In it, you try to override
public func getBase(x: Double) -> Double from BarChartHighlighter (link)
with
public override func getBase(y: Double) -> Double (link)

is it right to use y as the argument label, both semantically and as an override? Later you use it on an x value which makes me suspicious if this is a bug or not.

@liuxuan30
Copy link
Member

I guess it's not - compiler just cares about the function name, parameter types and return types

@danielgindi
Copy link
Collaborator

@Redoubts you are confused - it is not the label of the argument. It's the local name of the argument.
The first argument does not have a label unless explicitly specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants