<html><body><div>Because APIs are designed to be generic, protocols that must be conformed generally use types like Object or other base classes for a given framework. This introduces type casting&nbsp;verbosity when implementing the protocol for a specific use. I would like to see the ability to&nbsp;strengthen argument types in&nbsp;functions declared for protocol conformance.</div><div><br data-mce-bogus="1"></div><div>An example:</div><div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">class</span> Foo { }</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">class</span> Bar: <span style="font-variant-ligatures: no-common-ligatures; color: #3495af;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3495af;">Foo</span> { }</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">protocol</span> FooDelegate {</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">func</span> didPerformSomeAction(object: <span style="font-variant-ligatures: no-common-ligatures; color: #3495af;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3495af;">Foo</span>)</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">}</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">class</span> FooController: <span style="font-variant-ligatures: no-common-ligatures; color: #3495af;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3495af;">FooDelegate</span> {</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">func</span> didPerformSomeAction(<span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">var</span> object: <span style="font-variant-ligatures: no-common-ligatures; color: #3495af;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3495af;">Foo</span>) {</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;"><span style="font-variant-ligatures: no-common-ligatures; color: #000000;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #000000;">&nbsp; &nbsp; &nbsp; &nbsp; </span>// I know that object must be a Bar instance</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; object = object <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">as</span>! <span style="font-variant-ligatures: no-common-ligatures; color: #3495af;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3495af;">Bar</span></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;"><span style="font-variant-ligatures: no-common-ligatures; color: #000000;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #000000;">&nbsp; &nbsp; &nbsp; &nbsp; </span>// do something with object</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; }</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">}</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;"><span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">class</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #000000;"> ProposedFooController: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3495af;">FooDelegate</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #000000;"> { </span>// Type 'ProposedFooController' does not conform to protocol 'FooDelegate'</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #0433ff;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #0433ff;">func</span> didPerformSomeAction(object: <span style="font-variant-ligatures: no-common-ligatures; color: #3495af;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3495af;">Bar</span>) {</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #008f00;"><span style="font-variant-ligatures: no-common-ligatures; color: #000000;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #000000;">&nbsp; &nbsp; &nbsp; &nbsp; </span>// do something with Bar instance</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; }</p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">}</p></div><div><br data-mce-bogus="1"></div><div>The glaring issue I see outright is&nbsp;how the runtime should fail when `didPerformSomeAction` in `ProposedFooController` is called with a non-Bar instance... But perhaps it /should/ fail outright because&nbsp;the programmer has explicitly stated that the type should be Bar.</div><div></div><div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #eee8e4;" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #eee8e4;"></p></div></body></html>