Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- _ = new Foo<IWrapped<int>>();
- }
- }
- public interface IWrapped<T>
- {
- T Value { get; }
- }
- public class WrappedInt : IWrapped<int>
- {
- public int Value { get; }
- public WrappedInt(int value)
- {
- this.Value = value;
- }
- }
- public class WrappedLong : IWrapped<long>
- {
- public long Value { get; }
- public WrappedLong(long value)
- {
- this.Value = value;
- }
- }
- public class Foo<T> where T : IWrapped<int>, IWrapped<long>
- {
- public Foo()
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement