Skip to content

Instantly share code, notes, and snippets.

@tylerarnold
Created March 2, 2017 04:11
Show Gist options
  • Save tylerarnold/e821f24f27b2e6a36a004c2c6d319526 to your computer and use it in GitHub Desktop.
Save tylerarnold/e821f24f27b2e6a36a004c2c6d319526 to your computer and use it in GitHub Desktop.
swift 3.0 bug or deliberate behavior? At minimum a confusing error code.
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
protocol namer {
func name() -> String
}
extension namer {
func name() -> String {
return "foo"
}
}
class DemoClass: namer {
init () {
}
func demoNameInstance() -> String {
let n = name()
return n
}
class func demoNameClass() -> String {
let n = name()
return n
}
}
let a = DemoClass()
let b = a.demoNameInstance()
let c = DemoClass.demoNameClass()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment