Skip to content

Instantly share code, notes, and snippets.

@kkozmic
Created June 12, 2010 10:33
Show Gist options
  • Save kkozmic/435622 to your computer and use it in GitHub Desktop.
Save kkozmic/435622 to your computer and use it in GitHub Desktop.
public interface IReference<out T> {}
public class ComponentReference<T> : IReference<T> {}
// somewhere
public static IReference<IInterceptor> ForType<T>() where T:IInterceptor
{
// this won't compile
return new ComponentReference<T>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment