Skip to content

Instantly share code, notes, and snippets.

@PShuvaev
Last active August 29, 2015 14:16
Show Gist options
  • Save PShuvaev/7785fc8596db55f14dab to your computer and use it in GitHub Desktop.
Save PShuvaev/7785fc8596db55f14dab to your computer and use it in GitHub Desktop.
interface ISomeInterface {}
class SomeInterfaceImpl : ISomeInterface {}
/* compilation error!
interface Base {
ISomeInterface some { get; set; }
}
class ChildBase : Base {
public SimeInterfaceImpl some { get; set; }
}
*/
interface Base<T> where T : ISomeInterface {
T some { get; set; }
}
class ChildBase : Base<SomeInterfaceImpl> {
public SomeInterfaceImpl some { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment