Skip to content

Instantly share code, notes, and snippets.

@PShuvaev
Last active August 29, 2015 14:16
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 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