Skip to content

Instantly share code, notes, and snippets.

@adamkuipers
Created October 9, 2015 19:55
Show Gist options
  • Save adamkuipers/1126ad09a0478d64f069 to your computer and use it in GitHub Desktop.
Save adamkuipers/1126ad09a0478d64f069 to your computer and use it in GitHub Desktop.
Function overloading swift bug
// Doesn't work.
func doBimpy(f1: Bimpy, _ f2: Bimpy) -> Bimpy {
return Bimpy()
}
// Works
func doBimpy2(f1: Bimpy, _ f2: Bimpy) -> Bimpy {
return Bimpy()
}
class Bimpy {
func doBimpy() -> Bimpy {
return Bimpy()
}
func doBimpyWith(f: Bimpy) -> Bimpy {
return doBimpy(self, f)
}
func doBimpyWith2(f: Bimpy) -> Bimpy {
return doBimpy2(self, f)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment