public GenericType()
        {
            nextedType = new NestedGeneric <T>();

            if (typeof(T) == typeof(string) && typeof(T) == typeof(int))
            {
                Console.WriteLine("impossable");
            }
        }
 public async Task RuntimeCodeGenNestedGenericTest()
 {
     const int Expected = 123985;
     var grain = GrainFactory.GetGrain<INestedGenericGrain>(Guid.NewGuid());
     
     var nestedGeneric = new NestedGeneric<int> { Payload = new NestedGeneric<int>.Nested { Value = Expected } };
     var actual = await grain.Do(nestedGeneric);
     Assert.AreEqual(Expected, actual, "NestedGeneric<int>.Nested value should round-trip correctly.");
     
     var nestedConstructedGeneric = new NestedConstructedGeneric
     {
         Payload = new NestedConstructedGeneric.Nested<int> { Value = Expected }
     };
     actual = await grain.Do(nestedConstructedGeneric);
     Assert.AreEqual(Expected, actual, "NestedConstructedGeneric.Nested<int> value should round-trip correctly.");
 }
示例#3
0
 /// <summary>
 /// Generic method with ref param.
 /// </summary>
 /// <typeparam name="M">The generic</typeparam>
 /// <param name="n">The param</param>
 /// <returns></returns>
 public Boolean TryRefMethodGeneric <M>(ref NestedGeneric <M> n)
 {
     return(false);
 }
示例#4
0
 public void MethodWithPartiallyClosedNestedGenericType <T1> (NestedGeneric <T1> p1, NestedGeneric <TType1> p2)
 {
     Dev.Null = p1;
     Dev.Null = p2;
 }
示例#5
0
 public void MethodWithNestedGenericType(NestedGeneric <int> p1)
 {
     Dev.Null = p1;
 }