Having this function
private func date(from string: String) {
// Do thing with string
}
when calling it with
let date = date(from: "11:30")
it produces the following error
Variable used within its own initial value
obviously changing the code to
let anythingButDate = date(from: "11:30")
will make the error go away but I am trying to understand why there is a conflict between variable name and method name in the first place.
UPDATE:
To be more precise - I understand that the compiler is having issues with giving the variable and the function the same name but I am curious why can't it distinguish that one is a variable name and the other is a function name.