Skip to content

Instantly share code, notes, and snippets.

@kylebshr
Created March 6, 2017 05:40
Show Gist options
  • Save kylebshr/c058dfaa122d2439cbc87d346c97a3e6 to your computer and use it in GitHub Desktop.
Save kylebshr/c058dfaa122d2439cbc87d346c97a3e6 to your computer and use it in GitHub Desktop.
Weird Generic Default Argument Thing
//: Playground - noun: a place where people can play
import UIKit
class Foo<T> {
init(first: T, second: Int = 10) {}
}
class Bar: Foo<Int> {
static func makeBar() -> Bar {
return Bar(first: 5)
}
}
Bar.makeBar()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment