PageRenderTime 104ms CodeModel.GetById 11ms app.highlight 70ms RepoModel.GetById 1ms app.codeStats 4ms

/IronPython_Main/Runtime/Tests/ETScenariosCSLinq/CSLinq/ExpressionCompiler/constant_BackSl_test0.cs

#
C# | 17067 lines | 13916 code | 2661 blank | 490 comment | 1717 complexity | 22396c4bece7d3cee26efab926f9d6e0 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1#if !CLR2
   2using System.Linq.Expressions;
   3#else
   4using Microsoft.Scripting.Ast;
   5using Microsoft.Scripting.Utils;
   6#endif
   7
   8using System.Reflection;
   9using System;
  10namespace ExpressionCompiler { 
  11	
  12			
  13			//-------- Scenario 1706
  14			namespace Scenario1706{
  15				
  16				public class Test
  17				{
  18			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check0__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
  19			    public static Expression check0__() {
  20			       if(Main() != 0 ) {
  21			           throw new Exception();
  22			       } else { 
  23			           return Expression.Constant(0);
  24			       }
  25			    }
  26				public     static int Main()
  27				    {
  28				        Ext.StartCapture();
  29				        bool success = false;
  30				        try
  31				        {
  32				            success = check0();
  33				        }
  34				        finally
  35				        {
  36				            Ext.StopCapture();
  37				        }
  38				        return success ? 0 : 1;
  39				    }
  40				
  41				    static bool check0() {
  42				        foreach (byte val in new byte[] { 0, 1, byte.MaxValue }) {
  43				            if (!check0(val)) {
  44				                return false;
  45				            }
  46				        }
  47				        return true;
  48				    }
  49				
  50				    static bool check0(byte val) {
  51				        Expression<Func<byte>> e =
  52				            Expression.Lambda<Func<byte>>(
  53				                Expression.Constant(val, typeof(byte)),
  54				                new System.Collections.Generic.List<ParameterExpression>());
  55				        Func<byte> f = e.Compile();
  56				        return object.Equals(f(), val);
  57				    }
  58				}
  59			
  60			
  61			public  static class Ext {
  62			    public static void StartCapture() {
  63			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
  64			//        m.Invoke(null, new object[] { "test.dll" });
  65			    }
  66			
  67			    public static void StopCapture() {
  68			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
  69			//        m.Invoke(null, new object[0]);
  70			    }
  71			
  72			    public static bool IsIntegralOrEnum(Type type) {
  73			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
  74			            case TypeCode.Byte:
  75			            case TypeCode.SByte:
  76			            case TypeCode.Int16:
  77			            case TypeCode.Int32:
  78			            case TypeCode.Int64:
  79			            case TypeCode.UInt16:
  80			            case TypeCode.UInt32:
  81			            case TypeCode.UInt64:
  82			                return true;
  83			            default:
  84			                return false;
  85			        }
  86			    }
  87			
  88			    public static bool IsFloating(Type type) {
  89			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
  90			            case TypeCode.Single:
  91			            case TypeCode.Double:
  92			                return true;
  93			            default:
  94			                return false;
  95			        }
  96			    }
  97			
  98			    public static Type GetNonNullableType(Type type) {
  99			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 100			                type.GetGenericArguments()[0] :
 101			                type;
 102			    }
 103			}
 104			
 105		
 106	}
 107			
 108			//-------- Scenario 1707
 109			namespace Scenario1707{
 110				
 111				public class Test
 112				{
 113			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check1__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 114			    public static Expression check1__() {
 115			       if(Main() != 0 ) {
 116			           throw new Exception();
 117			       } else { 
 118			           return Expression.Constant(0);
 119			       }
 120			    }
 121				public     static int Main()
 122				    {
 123				        Ext.StartCapture();
 124				        bool success = false;
 125				        try
 126				        {
 127				            success = check1();
 128				        }
 129				        finally
 130				        {
 131				            Ext.StopCapture();
 132				        }
 133				        return success ? 0 : 1;
 134				    }
 135				
 136				    static bool check1() {
 137				        foreach (ushort val in new ushort[] { 0, 1, ushort.MaxValue }) {
 138				            if (!check1(val)) {
 139				                return false;
 140				            }
 141				        }
 142				        return true;
 143				    }
 144				
 145				    static bool check1(ushort val) {
 146				        Expression<Func<ushort>> e =
 147				            Expression.Lambda<Func<ushort>>(
 148				                Expression.Constant(val, typeof(ushort)),
 149				                new System.Collections.Generic.List<ParameterExpression>());
 150				        Func<ushort> f = e.Compile();
 151				        return object.Equals(f(), val);
 152				    }
 153				}
 154			
 155			
 156			public  static class Ext {
 157			    public static void StartCapture() {
 158			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 159			//        m.Invoke(null, new object[] { "test.dll" });
 160			    }
 161			
 162			    public static void StopCapture() {
 163			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 164			//        m.Invoke(null, new object[0]);
 165			    }
 166			
 167			    public static bool IsIntegralOrEnum(Type type) {
 168			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 169			            case TypeCode.Byte:
 170			            case TypeCode.SByte:
 171			            case TypeCode.Int16:
 172			            case TypeCode.Int32:
 173			            case TypeCode.Int64:
 174			            case TypeCode.UInt16:
 175			            case TypeCode.UInt32:
 176			            case TypeCode.UInt64:
 177			                return true;
 178			            default:
 179			                return false;
 180			        }
 181			    }
 182			
 183			    public static bool IsFloating(Type type) {
 184			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 185			            case TypeCode.Single:
 186			            case TypeCode.Double:
 187			                return true;
 188			            default:
 189			                return false;
 190			        }
 191			    }
 192			
 193			    public static Type GetNonNullableType(Type type) {
 194			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 195			                type.GetGenericArguments()[0] :
 196			                type;
 197			    }
 198			}
 199			
 200		
 201	}
 202			
 203			//-------- Scenario 1708
 204			namespace Scenario1708{
 205				
 206				public class Test
 207				{
 208			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check2__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 209			    public static Expression check2__() {
 210			       if(Main() != 0 ) {
 211			           throw new Exception();
 212			       } else { 
 213			           return Expression.Constant(0);
 214			       }
 215			    }
 216				public     static int Main()
 217				    {
 218				        Ext.StartCapture();
 219				        bool success = false;
 220				        try
 221				        {
 222				            success = check2();
 223				        }
 224				        finally
 225				        {
 226				            Ext.StopCapture();
 227				        }
 228				        return success ? 0 : 1;
 229				    }
 230				
 231				    static bool check2() {
 232				        foreach (uint val in new uint[] { 0, 1, uint.MaxValue }) {
 233				            if (!check2(val)) {
 234				                return false;
 235				            }
 236				        }
 237				        return true;
 238				    }
 239				
 240				    static bool check2(uint val) {
 241				        Expression<Func<uint>> e =
 242				            Expression.Lambda<Func<uint>>(
 243				                Expression.Constant(val, typeof(uint)),
 244				                new System.Collections.Generic.List<ParameterExpression>());
 245				        Func<uint> f = e.Compile();
 246				        return object.Equals(f(), val);
 247				    }
 248				}
 249			
 250			
 251			public  static class Ext {
 252			    public static void StartCapture() {
 253			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 254			//        m.Invoke(null, new object[] { "test.dll" });
 255			    }
 256			
 257			    public static void StopCapture() {
 258			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 259			//        m.Invoke(null, new object[0]);
 260			    }
 261			
 262			    public static bool IsIntegralOrEnum(Type type) {
 263			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 264			            case TypeCode.Byte:
 265			            case TypeCode.SByte:
 266			            case TypeCode.Int16:
 267			            case TypeCode.Int32:
 268			            case TypeCode.Int64:
 269			            case TypeCode.UInt16:
 270			            case TypeCode.UInt32:
 271			            case TypeCode.UInt64:
 272			                return true;
 273			            default:
 274			                return false;
 275			        }
 276			    }
 277			
 278			    public static bool IsFloating(Type type) {
 279			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 280			            case TypeCode.Single:
 281			            case TypeCode.Double:
 282			                return true;
 283			            default:
 284			                return false;
 285			        }
 286			    }
 287			
 288			    public static Type GetNonNullableType(Type type) {
 289			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 290			                type.GetGenericArguments()[0] :
 291			                type;
 292			    }
 293			}
 294			
 295		
 296	}
 297			
 298			//-------- Scenario 1709
 299			namespace Scenario1709{
 300				
 301				public class Test
 302				{
 303			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check3__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 304			    public static Expression check3__() {
 305			       if(Main() != 0 ) {
 306			           throw new Exception();
 307			       } else { 
 308			           return Expression.Constant(0);
 309			       }
 310			    }
 311				public     static int Main()
 312				    {
 313				        Ext.StartCapture();
 314				        bool success = false;
 315				        try
 316				        {
 317				            success = check3();
 318				        }
 319				        finally
 320				        {
 321				            Ext.StopCapture();
 322				        }
 323				        return success ? 0 : 1;
 324				    }
 325				
 326				    static bool check3() {
 327				        foreach (ulong val in new ulong[] { 0, 1, ulong.MaxValue }) {
 328				            if (!check3(val)) {
 329				                return false;
 330				            }
 331				        }
 332				        return true;
 333				    }
 334				
 335				    static bool check3(ulong val) {
 336				        Expression<Func<ulong>> e =
 337				            Expression.Lambda<Func<ulong>>(
 338				                Expression.Constant(val, typeof(ulong)),
 339				                new System.Collections.Generic.List<ParameterExpression>());
 340				        Func<ulong> f = e.Compile();
 341				        return object.Equals(f(), val);
 342				    }
 343				}
 344			
 345			
 346			public  static class Ext {
 347			    public static void StartCapture() {
 348			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 349			//        m.Invoke(null, new object[] { "test.dll" });
 350			    }
 351			
 352			    public static void StopCapture() {
 353			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 354			//        m.Invoke(null, new object[0]);
 355			    }
 356			
 357			    public static bool IsIntegralOrEnum(Type type) {
 358			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 359			            case TypeCode.Byte:
 360			            case TypeCode.SByte:
 361			            case TypeCode.Int16:
 362			            case TypeCode.Int32:
 363			            case TypeCode.Int64:
 364			            case TypeCode.UInt16:
 365			            case TypeCode.UInt32:
 366			            case TypeCode.UInt64:
 367			                return true;
 368			            default:
 369			                return false;
 370			        }
 371			    }
 372			
 373			    public static bool IsFloating(Type type) {
 374			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 375			            case TypeCode.Single:
 376			            case TypeCode.Double:
 377			                return true;
 378			            default:
 379			                return false;
 380			        }
 381			    }
 382			
 383			    public static Type GetNonNullableType(Type type) {
 384			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 385			                type.GetGenericArguments()[0] :
 386			                type;
 387			    }
 388			}
 389			
 390		
 391	}
 392			
 393			//-------- Scenario 1710
 394			namespace Scenario1710{
 395				
 396				public class Test
 397				{
 398			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check4__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 399			    public static Expression check4__() {
 400			       if(Main() != 0 ) {
 401			           throw new Exception();
 402			       } else { 
 403			           return Expression.Constant(0);
 404			       }
 405			    }
 406				public     static int Main()
 407				    {
 408				        Ext.StartCapture();
 409				        bool success = false;
 410				        try
 411				        {
 412				            success = check4();
 413				        }
 414				        finally
 415				        {
 416				            Ext.StopCapture();
 417				        }
 418				        return success ? 0 : 1;
 419				    }
 420				
 421				    static bool check4() {
 422				        foreach (sbyte val in new sbyte[] { 0, 1, -1, sbyte.MinValue, sbyte.MaxValue }) {
 423				            if (!check4(val)) {
 424				                return false;
 425				            }
 426				        }
 427				        return true;
 428				    }
 429				
 430				    static bool check4(sbyte val) {
 431				        Expression<Func<sbyte>> e =
 432				            Expression.Lambda<Func<sbyte>>(
 433				                Expression.Constant(val, typeof(sbyte)),
 434				                new System.Collections.Generic.List<ParameterExpression>());
 435				        Func<sbyte> f = e.Compile();
 436				        return object.Equals(f(), val);
 437				    }
 438				}
 439			
 440			
 441			public  static class Ext {
 442			    public static void StartCapture() {
 443			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 444			//        m.Invoke(null, new object[] { "test.dll" });
 445			    }
 446			
 447			    public static void StopCapture() {
 448			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 449			//        m.Invoke(null, new object[0]);
 450			    }
 451			
 452			    public static bool IsIntegralOrEnum(Type type) {
 453			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 454			            case TypeCode.Byte:
 455			            case TypeCode.SByte:
 456			            case TypeCode.Int16:
 457			            case TypeCode.Int32:
 458			            case TypeCode.Int64:
 459			            case TypeCode.UInt16:
 460			            case TypeCode.UInt32:
 461			            case TypeCode.UInt64:
 462			                return true;
 463			            default:
 464			                return false;
 465			        }
 466			    }
 467			
 468			    public static bool IsFloating(Type type) {
 469			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 470			            case TypeCode.Single:
 471			            case TypeCode.Double:
 472			                return true;
 473			            default:
 474			                return false;
 475			        }
 476			    }
 477			
 478			    public static Type GetNonNullableType(Type type) {
 479			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 480			                type.GetGenericArguments()[0] :
 481			                type;
 482			    }
 483			}
 484			
 485		
 486	}
 487			
 488			//-------- Scenario 1711
 489			namespace Scenario1711{
 490				
 491				public class Test
 492				{
 493			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check5__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 494			    public static Expression check5__() {
 495			       if(Main() != 0 ) {
 496			           throw new Exception();
 497			       } else { 
 498			           return Expression.Constant(0);
 499			       }
 500			    }
 501				public     static int Main()
 502				    {
 503				        Ext.StartCapture();
 504				        bool success = false;
 505				        try
 506				        {
 507				            success = check5();
 508				        }
 509				        finally
 510				        {
 511				            Ext.StopCapture();
 512				        }
 513				        return success ? 0 : 1;
 514				    }
 515				
 516				    static bool check5() {
 517				        foreach (short val in new short[] { 0, 1, -1, short.MinValue, short.MaxValue }) {
 518				            if (!check5(val)) {
 519				                return false;
 520				            }
 521				        }
 522				        return true;
 523				    }
 524				
 525				    static bool check5(short val) {
 526				        Expression<Func<short>> e =
 527				            Expression.Lambda<Func<short>>(
 528				                Expression.Constant(val, typeof(short)),
 529				                new System.Collections.Generic.List<ParameterExpression>());
 530				        Func<short> f = e.Compile();
 531				        return object.Equals(f(), val);
 532				    }
 533				}
 534			
 535			
 536			public  static class Ext {
 537			    public static void StartCapture() {
 538			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 539			//        m.Invoke(null, new object[] { "test.dll" });
 540			    }
 541			
 542			    public static void StopCapture() {
 543			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 544			//        m.Invoke(null, new object[0]);
 545			    }
 546			
 547			    public static bool IsIntegralOrEnum(Type type) {
 548			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 549			            case TypeCode.Byte:
 550			            case TypeCode.SByte:
 551			            case TypeCode.Int16:
 552			            case TypeCode.Int32:
 553			            case TypeCode.Int64:
 554			            case TypeCode.UInt16:
 555			            case TypeCode.UInt32:
 556			            case TypeCode.UInt64:
 557			                return true;
 558			            default:
 559			                return false;
 560			        }
 561			    }
 562			
 563			    public static bool IsFloating(Type type) {
 564			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 565			            case TypeCode.Single:
 566			            case TypeCode.Double:
 567			                return true;
 568			            default:
 569			                return false;
 570			        }
 571			    }
 572			
 573			    public static Type GetNonNullableType(Type type) {
 574			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 575			                type.GetGenericArguments()[0] :
 576			                type;
 577			    }
 578			}
 579			
 580		
 581	}
 582			
 583			//-------- Scenario 1712
 584			namespace Scenario1712{
 585				
 586				public class Test
 587				{
 588			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check6__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 589			    public static Expression check6__() {
 590			       if(Main() != 0 ) {
 591			           throw new Exception();
 592			       } else { 
 593			           return Expression.Constant(0);
 594			       }
 595			    }
 596				public     static int Main()
 597				    {
 598				        Ext.StartCapture();
 599				        bool success = false;
 600				        try
 601				        {
 602				            success = check6();
 603				        }
 604				        finally
 605				        {
 606				            Ext.StopCapture();
 607				        }
 608				        return success ? 0 : 1;
 609				    }
 610				
 611				    static bool check6() {
 612				        foreach (int val in new int[] { 0, 1, -1, int.MinValue, int.MaxValue }) {
 613				            if (!check6(val)) {
 614				                return false;
 615				            }
 616				        }
 617				        return true;
 618				    }
 619				
 620				    static bool check6(int val) {
 621				        Expression<Func<int>> e =
 622				            Expression.Lambda<Func<int>>(
 623				                Expression.Constant(val, typeof(int)),
 624				                new System.Collections.Generic.List<ParameterExpression>());
 625				        Func<int> f = e.Compile();
 626				        return object.Equals(f(), val);
 627				    }
 628				}
 629			
 630			
 631			public  static class Ext {
 632			    public static void StartCapture() {
 633			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 634			//        m.Invoke(null, new object[] { "test.dll" });
 635			    }
 636			
 637			    public static void StopCapture() {
 638			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 639			//        m.Invoke(null, new object[0]);
 640			    }
 641			
 642			    public static bool IsIntegralOrEnum(Type type) {
 643			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 644			            case TypeCode.Byte:
 645			            case TypeCode.SByte:
 646			            case TypeCode.Int16:
 647			            case TypeCode.Int32:
 648			            case TypeCode.Int64:
 649			            case TypeCode.UInt16:
 650			            case TypeCode.UInt32:
 651			            case TypeCode.UInt64:
 652			                return true;
 653			            default:
 654			                return false;
 655			        }
 656			    }
 657			
 658			    public static bool IsFloating(Type type) {
 659			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 660			            case TypeCode.Single:
 661			            case TypeCode.Double:
 662			                return true;
 663			            default:
 664			                return false;
 665			        }
 666			    }
 667			
 668			    public static Type GetNonNullableType(Type type) {
 669			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 670			                type.GetGenericArguments()[0] :
 671			                type;
 672			    }
 673			}
 674			
 675		
 676	}
 677			
 678			//-------- Scenario 1713
 679			namespace Scenario1713{
 680				
 681				public class Test
 682				{
 683			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check7__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 684			    public static Expression check7__() {
 685			       if(Main() != 0 ) {
 686			           throw new Exception();
 687			       } else { 
 688			           return Expression.Constant(0);
 689			       }
 690			    }
 691				public     static int Main()
 692				    {
 693				        Ext.StartCapture();
 694				        bool success = false;
 695				        try
 696				        {
 697				            success = check7();
 698				        }
 699				        finally
 700				        {
 701				            Ext.StopCapture();
 702				        }
 703				        return success ? 0 : 1;
 704				    }
 705				
 706				    static bool check7() {
 707				        foreach (long val in new long[] { 0, 1, -1, long.MinValue, long.MaxValue }) {
 708				            if (!check7(val)) {
 709				                return false;
 710				            }
 711				        }
 712				        return true;
 713				    }
 714				
 715				    static bool check7(long val) {
 716				        Expression<Func<long>> e =
 717				            Expression.Lambda<Func<long>>(
 718				                Expression.Constant(val, typeof(long)),
 719				                new System.Collections.Generic.List<ParameterExpression>());
 720				        Func<long> f = e.Compile();
 721				        return object.Equals(f(), val);
 722				    }
 723				}
 724			
 725			
 726			public  static class Ext {
 727			    public static void StartCapture() {
 728			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 729			//        m.Invoke(null, new object[] { "test.dll" });
 730			    }
 731			
 732			    public static void StopCapture() {
 733			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 734			//        m.Invoke(null, new object[0]);
 735			    }
 736			
 737			    public static bool IsIntegralOrEnum(Type type) {
 738			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 739			            case TypeCode.Byte:
 740			            case TypeCode.SByte:
 741			            case TypeCode.Int16:
 742			            case TypeCode.Int32:
 743			            case TypeCode.Int64:
 744			            case TypeCode.UInt16:
 745			            case TypeCode.UInt32:
 746			            case TypeCode.UInt64:
 747			                return true;
 748			            default:
 749			                return false;
 750			        }
 751			    }
 752			
 753			    public static bool IsFloating(Type type) {
 754			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 755			            case TypeCode.Single:
 756			            case TypeCode.Double:
 757			                return true;
 758			            default:
 759			                return false;
 760			        }
 761			    }
 762			
 763			    public static Type GetNonNullableType(Type type) {
 764			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 765			                type.GetGenericArguments()[0] :
 766			                type;
 767			    }
 768			}
 769			
 770		
 771	}
 772			
 773			//-------- Scenario 1714
 774			namespace Scenario1714{
 775				
 776				public class Test
 777				{
 778			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check8__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 779			    public static Expression check8__() {
 780			       if(Main() != 0 ) {
 781			           throw new Exception();
 782			       } else { 
 783			           return Expression.Constant(0);
 784			       }
 785			    }
 786				public     static int Main()
 787				    {
 788				        Ext.StartCapture();
 789				        bool success = false;
 790				        try
 791				        {
 792				            success = check8();
 793				        }
 794				        finally
 795				        {
 796				            Ext.StopCapture();
 797				        }
 798				        return success ? 0 : 1;
 799				    }
 800				
 801				    static bool check8() {
 802				        foreach (float val in new float[] { 0, 1, -1, float.MinValue, float.MaxValue, float.Epsilon, float.NegativeInfinity, float.PositiveInfinity, float.NaN }) {
 803				            if (!check8(val)) {
 804				                return false;
 805				            }
 806				        }
 807				        return true;
 808				    }
 809				
 810				    static bool check8(float val) {
 811				        Expression<Func<float>> e =
 812				            Expression.Lambda<Func<float>>(
 813				                Expression.Constant(val, typeof(float)),
 814				                new System.Collections.Generic.List<ParameterExpression>());
 815				        Func<float> f = e.Compile();
 816				        return object.Equals(f(), val);
 817				    }
 818				}
 819			
 820			
 821			public  static class Ext {
 822			    public static void StartCapture() {
 823			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 824			//        m.Invoke(null, new object[] { "test.dll" });
 825			    }
 826			
 827			    public static void StopCapture() {
 828			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 829			//        m.Invoke(null, new object[0]);
 830			    }
 831			
 832			    public static bool IsIntegralOrEnum(Type type) {
 833			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 834			            case TypeCode.Byte:
 835			            case TypeCode.SByte:
 836			            case TypeCode.Int16:
 837			            case TypeCode.Int32:
 838			            case TypeCode.Int64:
 839			            case TypeCode.UInt16:
 840			            case TypeCode.UInt32:
 841			            case TypeCode.UInt64:
 842			                return true;
 843			            default:
 844			                return false;
 845			        }
 846			    }
 847			
 848			    public static bool IsFloating(Type type) {
 849			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 850			            case TypeCode.Single:
 851			            case TypeCode.Double:
 852			                return true;
 853			            default:
 854			                return false;
 855			        }
 856			    }
 857			
 858			    public static Type GetNonNullableType(Type type) {
 859			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 860			                type.GetGenericArguments()[0] :
 861			                type;
 862			    }
 863			}
 864			
 865		
 866	}
 867			
 868			//-------- Scenario 1715
 869			namespace Scenario1715{
 870				
 871				public class Test
 872				{
 873			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check9__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 874			    public static Expression check9__() {
 875			       if(Main() != 0 ) {
 876			           throw new Exception();
 877			       } else { 
 878			           return Expression.Constant(0);
 879			       }
 880			    }
 881				public     static int Main()
 882				    {
 883				        Ext.StartCapture();
 884				        bool success = false;
 885				        try
 886				        {
 887				            success = check9();
 888				        }
 889				        finally
 890				        {
 891				            Ext.StopCapture();
 892				        }
 893				        return success ? 0 : 1;
 894				    }
 895				
 896				    static bool check9() {
 897				        foreach (double val in new double[] { 0, 1, -1, double.MinValue, double.MaxValue, double.Epsilon, double.NegativeInfinity, double.PositiveInfinity, double.NaN }) {
 898				            if (!check9(val)) {
 899				                return false;
 900				            }
 901				        }
 902				        return true;
 903				    }
 904				
 905				    static bool check9(double val) {
 906				        Expression<Func<double>> e =
 907				            Expression.Lambda<Func<double>>(
 908				                Expression.Constant(val, typeof(double)),
 909				                new System.Collections.Generic.List<ParameterExpression>());
 910				        Func<double> f = e.Compile();
 911				        return object.Equals(f(), val);
 912				    }
 913				}
 914			
 915			
 916			public  static class Ext {
 917			    public static void StartCapture() {
 918			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 919			//        m.Invoke(null, new object[] { "test.dll" });
 920			    }
 921			
 922			    public static void StopCapture() {
 923			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
 924			//        m.Invoke(null, new object[0]);
 925			    }
 926			
 927			    public static bool IsIntegralOrEnum(Type type) {
 928			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 929			            case TypeCode.Byte:
 930			            case TypeCode.SByte:
 931			            case TypeCode.Int16:
 932			            case TypeCode.Int32:
 933			            case TypeCode.Int64:
 934			            case TypeCode.UInt16:
 935			            case TypeCode.UInt32:
 936			            case TypeCode.UInt64:
 937			                return true;
 938			            default:
 939			                return false;
 940			        }
 941			    }
 942			
 943			    public static bool IsFloating(Type type) {
 944			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
 945			            case TypeCode.Single:
 946			            case TypeCode.Double:
 947			                return true;
 948			            default:
 949			                return false;
 950			        }
 951			    }
 952			
 953			    public static Type GetNonNullableType(Type type) {
 954			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
 955			                type.GetGenericArguments()[0] :
 956			                type;
 957			    }
 958			}
 959			
 960		
 961	}
 962			
 963			//-------- Scenario 1716
 964			namespace Scenario1716{
 965				
 966				public class Test
 967				{
 968			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check10__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
 969			    public static Expression check10__() {
 970			       if(Main() != 0 ) {
 971			           throw new Exception();
 972			       } else { 
 973			           return Expression.Constant(0);
 974			       }
 975			    }
 976				public     static int Main()
 977				    {
 978				        Ext.StartCapture();
 979				        bool success = false;
 980				        try
 981				        {
 982				            success = check10();
 983				        }
 984				        finally
 985				        {
 986				            Ext.StopCapture();
 987				        }
 988				        return success ? 0 : 1;
 989				    }
 990				
 991				    static bool check10() {
 992				        foreach (decimal val in new decimal[] { decimal.Zero, decimal.One, decimal.MinusOne, decimal.MinValue, decimal.MaxValue }) {
 993				            if (!check10(val)) {
 994				                return false;
 995				            }
 996				        }
 997				        return true;
 998				    }
 999				
1000				    static bool check10(decimal val) {
1001				        Expression<Func<decimal>> e =
1002				            Expression.Lambda<Func<decimal>>(
1003				                Expression.Constant(val, typeof(decimal)),
1004				                new System.Collections.Generic.List<ParameterExpression>());
1005				        Func<decimal> f = e.Compile();
1006				        return object.Equals(f(), val);
1007				    }
1008				}
1009			
1010			
1011			public  static class Ext {
1012			    public static void StartCapture() {
1013			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1014			//        m.Invoke(null, new object[] { "test.dll" });
1015			    }
1016			
1017			    public static void StopCapture() {
1018			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1019			//        m.Invoke(null, new object[0]);
1020			    }
1021			
1022			    public static bool IsIntegralOrEnum(Type type) {
1023			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1024			            case TypeCode.Byte:
1025			            case TypeCode.SByte:
1026			            case TypeCode.Int16:
1027			            case TypeCode.Int32:
1028			            case TypeCode.Int64:
1029			            case TypeCode.UInt16:
1030			            case TypeCode.UInt32:
1031			            case TypeCode.UInt64:
1032			                return true;
1033			            default:
1034			                return false;
1035			        }
1036			    }
1037			
1038			    public static bool IsFloating(Type type) {
1039			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1040			            case TypeCode.Single:
1041			            case TypeCode.Double:
1042			                return true;
1043			            default:
1044			                return false;
1045			        }
1046			    }
1047			
1048			    public static Type GetNonNullableType(Type type) {
1049			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
1050			                type.GetGenericArguments()[0] :
1051			                type;
1052			    }
1053			}
1054			
1055		
1056	}
1057			
1058			//-------- Scenario 1717
1059			namespace Scenario1717{
1060				
1061				public class Test
1062				{
1063			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check11__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
1064			    public static Expression check11__() {
1065			       if(Main() != 0 ) {
1066			           throw new Exception();
1067			       } else { 
1068			           return Expression.Constant(0);
1069			       }
1070			    }
1071				public     static int Main()
1072				    {
1073				        Ext.StartCapture();
1074				        bool success = false;
1075				        try
1076				        {
1077				            success = check11();
1078				        }
1079				        finally
1080				        {
1081				            Ext.StopCapture();
1082				        }
1083				        return success ? 0 : 1;
1084				    }
1085				
1086				    static bool check11() {
1087				        foreach (char val in new char[] { '\0', '\b', 'A', '\uffff' }) {
1088				            if (!check11(val)) {
1089				                return false;
1090				            }
1091				        }
1092				        return true;
1093				    }
1094				
1095				    static bool check11(char val) {
1096				        Expression<Func<char>> e =
1097				            Expression.Lambda<Func<char>>(
1098				                Expression.Constant(val, typeof(char)),
1099				                new System.Collections.Generic.List<ParameterExpression>());
1100				        Func<char> f = e.Compile();
1101				        return object.Equals(f(), val);
1102				    }
1103				}
1104			
1105			
1106			public  static class Ext {
1107			    public static void StartCapture() {
1108			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1109			//        m.Invoke(null, new object[] { "test.dll" });
1110			    }
1111			
1112			    public static void StopCapture() {
1113			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1114			//        m.Invoke(null, new object[0]);
1115			    }
1116			
1117			    public static bool IsIntegralOrEnum(Type type) {
1118			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1119			            case TypeCode.Byte:
1120			            case TypeCode.SByte:
1121			            case TypeCode.Int16:
1122			            case TypeCode.Int32:
1123			            case TypeCode.Int64:
1124			            case TypeCode.UInt16:
1125			            case TypeCode.UInt32:
1126			            case TypeCode.UInt64:
1127			                return true;
1128			            default:
1129			                return false;
1130			        }
1131			    }
1132			
1133			    public static bool IsFloating(Type type) {
1134			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1135			            case TypeCode.Single:
1136			            case TypeCode.Double:
1137			                return true;
1138			            default:
1139			                return false;
1140			        }
1141			    }
1142			
1143			    public static Type GetNonNullableType(Type type) {
1144			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
1145			                type.GetGenericArguments()[0] :
1146			                type;
1147			    }
1148			}
1149			
1150		
1151	}
1152			
1153			//-------- Scenario 1718
1154			namespace Scenario1718{
1155				
1156				public class Test
1157				{
1158			    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check12__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
1159			    public static Expression check12__() {
1160			       if(Main() != 0 ) {
1161			           throw new Exception();
1162			       } else { 
1163			           return Expression.Constant(0);
1164			       }
1165			    }
1166				public     static int Main()
1167				    {
1168				        Ext.StartCapture();
1169				        bool success = false;
1170				        try
1171				        {
1172				            success = check12();
1173				        }
1174				        finally
1175				        {
1176				            Ext.StopCapture();
1177				        }
1178				        return success ? 0 : 1;
1179				    }
1180				
1181				    static bool check12() {
1182				        foreach (bool val in new bool[] { true, false }) {
1183				            if (!check12(val)) {
1184				                return false;
1185				            }
1186				        }
1187				        return true;
1188				    }
1189				
1190				    static bool check12(bool val) {
1191				        Expression<Func<bool>> e =
1192				            Expression.Lambda<Func<bool>>(
1193				                Expression.Constant(val, typeof(bool)),
1194				                new System.Collections.Generic.List<ParameterExpression>());
1195				        Func<bool> f = e.Compile();
1196				        return object.Equals(f(), val);
1197				    }
1198				}
1199			
1200			
1201			public  static class Ext {
1202			    public static void StartCapture() {
1203			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1204			//        m.Invoke(null, new object[] { "test.dll" });
1205			    }
1206			
1207			    public static void StopCapture() {
1208			//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1209			//        m.Invoke(null, new object[0]);
1210			    }
1211			
1212			    public static bool IsIntegralOrEnum(Type type) {
1213			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1214			            case TypeCode.Byte:
1215			            case TypeCode.SByte:
1216			            case TypeCode.Int16:
1217			            case TypeCode.Int32:
1218			            case TypeCode.Int64:
1219			            case TypeCode.UInt16:
1220			            case TypeCode.UInt32:
1221			            case TypeCode.UInt64:
1222			                return true;
1223			            default:
1224			                return false;
1225			        }
1226			    }
1227			
1228			    public static bool IsFloating(Type type) {
1229			        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1230			            case TypeCode.Single:
1231			            case TypeCode.Double:
1232			                return true;
1233			            default:
1234			                return false;
1235			        }
1236			    }
1237			
1238			    public static Type GetNonNullableType(Type type) {
1239			        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
1240			                type.GetGenericArguments()[0] :
1241			                type;
1242			    }
1243			}
1244			
1245		
1246	}
1247				
1248				//-------- Scenario 1719
1249				namespace Scenario1719{
1250					
1251					public class Test
1252					{
1253				    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check13__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
1254				    public static Expression check13__() {
1255				       if(Main() != 0 ) {
1256				           throw new Exception();
1257				       } else { 
1258				           return Expression.Constant(0);
1259				       }
1260				    }
1261					public     static int Main()
1262					    {
1263					        Ext.StartCapture();
1264					        bool success = false;
1265					        try
1266					        {
1267					            success = check13();
1268					        }
1269					        finally
1270					        {
1271					            Ext.StopCapture();
1272					        }
1273					        return success ? 0 : 1;
1274					    }
1275					
1276					    static bool check13() {
1277					        foreach (S val in new S[] { default(S), new S() }) {
1278					            if (!check13(val)) {
1279					                return false;
1280					            }
1281					        }
1282					        return true;
1283					    }
1284					
1285					    static bool check13(S val) {
1286					        Expression<Func<S>> e =
1287					            Expression.Lambda<Func<S>>(
1288					                Expression.Constant(val, typeof(S)),
1289					                new System.Collections.Generic.List<ParameterExpression>());
1290					        Func<S> f = e.Compile();
1291					        return object.Equals(f(), val);
1292					    }
1293					}
1294				
1295				
1296				public  static class Ext {
1297				    public static void StartCapture() {
1298				//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StartCaptureToFile", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1299				//        m.Invoke(null, new object[] { "test.dll" });
1300				    }
1301				
1302				    public static void StopCapture() {
1303				//        MethodInfo m = Assembly.GetAssembly(typeof(Expression)).GetType("System.Linq.Expressions.ExpressionCompiler").GetMethod("StopCapture", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
1304				//        m.Invoke(null, new object[0]);
1305				    }
1306				
1307				    public static bool IsIntegralOrEnum(Type type) {
1308				        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1309				            case TypeCode.Byte:
1310				            case TypeCode.SByte:
1311				            case TypeCode.Int16:
1312				            case TypeCode.Int32:
1313				            case TypeCode.Int64:
1314				            case TypeCode.UInt16:
1315				            case TypeCode.UInt32:
1316				            case TypeCode.UInt64:
1317				                return true;
1318				            default:
1319				                return false;
1320				        }
1321				    }
1322				
1323				    public static bool IsFloating(Type type) {
1324				        switch (Type.GetTypeCode(GetNonNullableType(type))) {
1325				            case TypeCode.Single:
1326				            case TypeCode.Double:
1327				                return true;
1328				            default:
1329				                return false;
1330				        }
1331				    }
1332				
1333				    public static Type GetNonNullableType(Type type) {
1334				        return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>) ?
1335				                type.GetGenericArguments()[0] :
1336				                type;
1337				    }
1338				}
1339				
1340			
1341			
1342			
1343			public interface I {
1344			  void M();
1345			}
1346			
1347			public  class C : IEquatable<C>, I {
1348			    void I.M() {
1349			    }
1350			
1351			    public override bool Equals(object o) {
1352			        return o is C && Equals((C) o);
1353			    }
1354			
1355			    public bool Equals(C c) {
1356			        return c != null;
1357			    }
1358			
1359			    public override int GetHashCode() {
1360			        return 0;
1361			    }
1362			}
1363			
1364			public  class D : C, IEquatable<D> {
1365			    public int Val;
1366			    public D() {
1367			    }
1368			    public D(int val) {
1369			        Val = val;
1370			    }
1371			
1372			    public override bool Equals(object o) {
1373			        return o is D && Equals((D) o);
1374			    }
1375			
1376			    public bool Equals(D d) {
1377			        return d != null && d.Val == Val;
1378			    }
1379			
1380			    public override int GetHashCode() {
1381			        return Val;
1382			    }
1383			}
1384			
1385			public enum E {
1386			  A=1, B=2
1387			}
1388			
1389			public enum El : long {
1390			  A, B, C
1391			}
1392			
1393			public struct S : IEquatable<S> {
1394			    public override bool Equals(object o) {
1395			        return (o is S) && Equals((S) o);
1396			    }
1397			    public bool Equals(S other) {
1398			        return true;
1399			    }
1400			    public override int GetHashCode() {
1401			        return 0;
1402			    }
1403			}
1404			
1405			public struct Sp : IEquatable<Sp> {
1406			    public Sp(int i, double d) {
1407			        I = i;
1408			        D = d;
1409			    }
1410			
1411			    public int I;
1412			    public double D;
1413			
1414			    public override bool Equals(object o) {
1415			        return (o is Sp) && Equals((Sp) o);
1416			    }
1417			    public bool Equals(Sp other) {
1418			        return other.I == I && other.D == D;
1419			    }
1420			    public override int GetHashCode() {
1421			        return I.GetHashCode() ^ D.GetHashCode();
1422			    }
1423			}
1424			
1425			public struct Ss : IEquatable<Ss> {
1426			    public Ss(S s) {
1427			        Val = s;
1428			    }
1429			
1430			    public S Val;
1431			
1432			    public override bool Equals(object o) {
1433			        return (o is Ss) && Equals((Ss) o);
1434			    }
1435			    public bool Equals(Ss other) {
1436			        return other.Val.Equals(Val);
1437			    }
1438			    public override int GetHashCode() {
1439			        return Val.GetHashCode();
1440			    }
1441			}
1442			
1443			public struct Sc : IEquatable<Sc> {
1444			    public Sc(string s) {
1445			        S = s;
1446			    }
1447			
1448			    public string S;
1449			
1450			    public override bool Equals(object o) {
1451			        return (o is Sc) && Equals((Sc) o);
1452			    }
1453			    public bool Equals(Sc other) {
1454			        return other.S == S;
1455			    }
1456			    public override int GetHashCode() {
1457			        return S.GetHashCode();
1458			    }
1459			}
1460			
1461			public struct Scs : IEquatable<Scs> {
1462			    public Scs(string s, S val) {
1463			        S = s;
1464			        Val = val;
1465			    }
1466			
1467			    public string S;
1468			    public S Val;
1469			
1470			    public override bool Equals(object o) {
1471			        return (o is Scs) && Equals((Scs) o);
1472			    }
1473			    public bool Equals(Scs other) {
1474			        return other.S == S && other.Val.Equals(Val);
1475			    }
1476			    public override int GetHashCode() {
1477			        return S.GetHashCode() ^ Val.GetHashCode();
1478			    }
1479			}
1480			
1481		
1482	}
1483				
1484				//-------- Scenario 1720
1485				namespace Scenario1720{
1486					
1487					public class Test
1488					{
1489				    [ETUtils.TestAttribute(ETUtils.TestState.Enabled, "check14__", new string[] { "positive", "cslinq", "FullTrustOnly","Pri1" })]
1490				    public static Expression check14__() {
1491				       if(Main() != 0 ) {
1492				           throw new Exception();
1493				       } else { 
1494				           return Expression.Constant(0);
1495				       }
1496				    }
1497					public     static int Main()
1498					    {
1499					        Ext.StartCapture();
1500					        bool success = false;
1501					        try
1502					        {
1503					            success = check14();
1504					        }
1505					        finally
1506					        {
1507					            Ext.StopCapture();
1508					        }
1509					        return success ? 0 : 1;
1510					    }
1511					
1512					    static bool check14() {
1513					        foreach (Sp val in new Sp[] { default(Sp), new Sp(), new Sp(5,5.0) }) {
1514					            if (!check14(val)) {
1515					         

Large files files are truncated, but you can click here to view the full file