Skip to content

Instantly share code, notes, and snippets.

@dduan
Created June 23, 2016 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dduan/613e29fcbf5ae4ed7c17b1fcfca63a43 to your computer and use it in GitHub Desktop.
Save dduan/613e29fcbf5ae4ed7c17b1fcfca63a43 to your computer and use it in GitHub Desktop.
Will this compile?
protocol X {
var value: Int { get }
init(value: Int)
}
func foo<T, U: X>(a: T) -> U {
return U(value: a.value)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment