Created
March 6, 2017 05:40
-
-
Save kylebshr/c058dfaa122d2439cbc87d346c97a3e6 to your computer and use it in GitHub Desktop.
Weird Generic Default Argument Thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: 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