+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_ClassConstraint_Neg {}
-
-
-
-.class public auto ansi beforefieldinit B
- extends [mscorlib]System.Object
-{
-
- // Generic method with class() constraint
- .method public hidebysig instance void
- method1<class T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit M_ClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<valuetype [types]NonGenStruct>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<valuetype [types]Enum1>()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit M_ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<valuetype [types]GenStruct<int32>>()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<valuetype [mscorlib]System.'Nullable`1'<int32>>()
-
- ret
- }
-
-}
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_ClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_ClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// NEGATIVE TESTS
-/* Test various combinations of constraints on methods
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference tyoe
-default ctor, valuetype
-
-Test each constraint with
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-*/
-
-using System;
-using System.Security;
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string type, string methodName, string violatingType)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
- Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException");
- pass = false;
- }
- catch (VerificationException e)
- {
-
-
- Test.CheckVerificationExceptionMessage(8311, e, type, methodName, violatingType);
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static void CheckVerificationExceptionMessage(uint ResourceID, VerificationException e, string type, string methodName, string violatingType)
- {
- // "Method %1.%2: type argument '%3' violates the constraint of type parameter '%4'."
- bool found1 = e.ToString().IndexOf(type + "." + methodName) >= 0;
- bool found2 = e.ToString().IndexOf(violatingType) >= 0;
- bool found3 = e.ToString().IndexOf("T") >= 0;
-
- if (!found1 || !found2 || !found3)
- {
- Console.WriteLine(" : Exception message is incorrect");
- Console.WriteLine("Expected: " + "Method " + type + "." + methodName + ": type argument '" + violatingType + "' violates the constraint of type parameter 'T'");
- Console.WriteLine("Actual: " + e.Message.ToString());
- pass = false;
- }
- else
- {
- Console.WriteLine(" : Caught expected exception");
- }
- }
-
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
-
-
- Check(new Case(M_DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "A", "method1", "ClassNoCtor");
- Check(new Case(M_DefaultCtorConstraint.Test4), "Generic argument is a delegate", "A", "method1", "Delegate1");
- Check(new Case(M_DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "A", "method1", "System.ValueType");
- Check(new Case(M_DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "A", "method1", "NonGenInterface");
-
- // WRONG?
- Check(new Case(M_DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "A", "method1", "ClassWithCtor[]");
-
- Check(new Case(M_DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "A", "method1", "GenClassNoCtor[System.Int32]");
- Check(new Case(M_DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "A", "method1", "GenInterface[System.Int32]");
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
-
- Check(new Case(M_ClassConstraint.Test3), "Generic argument is a struct", "B", "method1", "NonGenStruct");
- Check(new Case(M_ClassConstraint.Test8), "Generic argument is an enum", "B", "method1", "Enum1");
- Check(new Case(M_ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "B", "method1", "GenStruct[System.Int32]");
- Check(new Case(M_ClassConstraintGenTypes.Test6), "Generic argument is Nullable<T>", "B", "method1", "System.Nullable`1[System.Int32]");
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
-
- Check(new Case(M_StructConstraint.Test1), "Generic argument is a class with default ctor", "C", "method1", "ClassWithCtor");
- Check(new Case(M_StructConstraint.Test2), "Generic argument is a class with no default ctor", "C", "method1", "ClassNoCtor");
- Check(new Case(M_StructConstraint.Test4), "Generic argument is a delegate", "C", "method1", "Delegate1");
- Check(new Case(M_StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "C", "method1", "System.Object");
- Check(new Case(M_StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "C", "method1", "System.ValueType");
- Check(new Case(M_StructConstraint.Test7), "Generic argument is an interface", "C", "method1", "NonGenInterface");
- Check(new Case(M_StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "C", "method1", "ClassWithCtor[]");
-
- Check(new Case(M_StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "C", "method1", "GenClassWithCtor[System.Int32]");
- Check(new Case(M_StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "C", "method1", "GenClassNoCtor[System.Int32]");
- Check(new Case(M_StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "C", "method1", "GenInterface[System.Int32]");
- Check(new Case(M_StructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "C", "method1", "System.Nullable`1[System.Int32]");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
-
- Check(new Case(M_DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "D", "method1", "ClassNoCtor");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "D", "method1", "NonGenStruct");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "D", "method1", "Delegate1");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "D", "method1", "System.ValueType");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "D", "method1", "System.DateTime");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "D", "method1", "NonGenInterface");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "D", "method1", "Enum1");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "D", "method1", "ClassWithCtor[]");
-
-
- Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "D", "method1", "GenStruct[System.Int32]");
- Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "D", "method1", "GenClassNoCtor[System.Int32]");
- Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "D", "method1", "GenInterface[System.Int32]");
- Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "D", "method1", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]");
- Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "D", "method1", "System.Nullable`1[System.Int32]");
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
-
- Check(new Case(M_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "E", "method1", "ClassWithCtor");
- Check(new Case(M_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "E", "method1", "ClassNoCtor");
- Check(new Case(M_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "E", "method1", "Delegate1");
- Check(new Case(M_DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "E", "method1", "System.Object");
- Check(new Case(M_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "E", "method1", "System.ValueType");
- Check(new Case(M_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "E", "method1", "NonGenInterface");
-
- Check(new Case(M_DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "E", "method1", "NonGenStruct[]");
-
- Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "E", "method1", "GenClassWithCtor[System.Int32]");
- Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "E", "method1", "GenClassNoCtor[System.Int32]");
- Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "E", "method1", "GenInterface[System.Int32]");
- Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "E", "method1", "System.Nullable`1[System.Int32]");
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_Constraints_Negative</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_Constraints_Negative.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="Method_ClassConstraint_Neg.ilproj" />
- <ProjectReference Include="Method_DefaultCtorAndClassConstraint_Neg.ilproj" />
- <ProjectReference Include="Method_DefaultCtorAndStructConstraint_Neg.ilproj" />
- <ProjectReference Include="Method_DefaultCtorConstraint_Neg.ilproj" />
- <ProjectReference Include="Method_StructConstraint_Neg.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_DefaultCtorAndClassConstraint_Neg {}
-
-
-
-.class public auto ansi beforefieldinit D
- extends [mscorlib]System.Object
-{
-
- // Generic method with class() and new() constraints
- .method public hidebysig instance void
- method1<class .ctor T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]ClassNoCtor>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<valuetype [types]NonGenStruct>()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]Delegate1>()
-
- ret
- }
-
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [mscorlib]System.ValueType>()
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]NonGenInterface>()
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<valuetype [types]Enum1>()
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<valuetype [mscorlib]System.DateTime>()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]ClassWithCtor[]>()
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]GenClassNoCtor<int32>>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a generic struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<valuetype [types]GenStruct<int32>>()
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an generic interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]GenInterface<int32>>()
-
- ret
- }
-
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>()
-
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<valuetype [mscorlib]System.'Nullable`1'<int32>>()
-
- ret
- }
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_DefaultCtorAndClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_DefaultCtorAndClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_DefaultCtorAndStructConstraint_Neg {}
-
-
-
-.class public auto ansi beforefieldinit E
- extends [mscorlib]System.Object
-{
-
- // Generic method with struct() and new() constraints
- .method public hidebysig instance void
- method1<valuetype .ctor T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [types]ClassWithCtor>()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [types]ClassNoCtor>()
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [types]Delegate1>()
- ret
- }
-
-
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [mscorlib]System.Object>()
-
- ret
- }
-
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [mscorlib]System.ValueType>()
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [types]NonGenInterface>()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<valuetype [types]NonGenStruct[]>()
- ret
- }
-
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [types]GenClassWithCtor<int32>>()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [types]GenClassNoCtor<int32>>()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<class [types]GenInterface<int32>>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<valuetype [mscorlib]System.'Nullable`1'<int32>>()
-
- ret
- }
-
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_DefaultCtorAndStructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_DefaultCtorAndStructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_DefaultCtorConstraint_Neg {}
-
-
-.class public auto ansi beforefieldinit A
- extends [mscorlib]System.Object
-{
-
- // Generic method with new() constraint
- .method public hidebysig instance void
- method1<.ctor T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]ClassNoCtor>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]Delegate1>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [mscorlib]System.ValueType>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]NonGenInterface>()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]ClassWithCtor[]>()
-
- ret
- }
-
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]GenClassNoCtor<int32>>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]GenInterface<int32>>()
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_DefaultCtorConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_DefaultCtorConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_StructConstraint_Neg {}
-
-
-
-.class public auto ansi beforefieldinit C
- extends [mscorlib]System.Object
-{
-
- // Generic method with class() constraint
- .method public hidebysig instance void
- method1<valuetype T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit M_StructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]ClassWithCtor>()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]ClassNoCtor>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]Delegate1>()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [mscorlib]System.Object>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [mscorlib]System.ValueType>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]NonGenInterface>()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]ClassWithCtor[]>()
- ret
- }
-
-
-}
-
-.class public auto ansi beforefieldinit M_StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]GenClassWithCtor<int32>>()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]GenClassNoCtor<int32>>()
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<class [types]GenInterface<int32>>()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<valuetype [mscorlib]System.'Nullable`1'<int32>>()
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_StructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_StructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-<?xml version = "1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
+++ /dev/null
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816",
- "System.Collections": "4.0.10",
- "System.Collections.NonGeneric": "4.0.1-rc2-23816",
- "System.Collections.Specialized": "4.0.1-rc2-23816",
- "System.ComponentModel": "4.0.1-rc2-23816",
- "System.Console": "4.0.0-rc2-23816",
- "System.Diagnostics.Process": "4.1.0-rc2-23816",
- "System.Globalization": "4.0.10",
- "System.Globalization.Calendars": "4.0.0",
- "System.IO": "4.0.10",
- "System.IO.FileSystem": "4.0.0",
- "System.IO.FileSystem.Primitives": "4.0.0",
- "System.Linq": "4.0.1-rc2-23816",
- "System.Linq.Queryable": "4.0.1-rc2-23816",
- "System.Reflection": "4.0.10",
- "System.Reflection.Primitives": "4.0.0",
- "System.Runtime": "4.1.0-rc2-23816",
- "System.Runtime.Extensions": "4.0.10",
- "System.Runtime.Handles": "4.0.0",
- "System.Runtime.InteropServices": "4.1.0-rc2-23816",
- "System.Runtime.Loader": "4.0.0-rc2-23816",
- "System.Text.Encoding": "4.0.10",
- "System.Threading": "4.0.10",
- "System.Threading.Thread": "4.0.0-rc2-23816",
- "System.Xml.ReaderWriter": "4.0.11-rc2-23816",
- "System.Xml.XDocument": "4.0.11-rc2-23816",
- "System.Xml.XmlDocument": "4.0.1-rc2-23816",
- "System.Xml.XmlSerializer": "4.0.11-rc2-23816"
- },
- "frameworks": {
- "dnxcore50": {}
- },
- "runtimes": {
- "win7-x86": {},
- "win7-x64": {},
- "ubuntu.14.04-x64": {},
- "osx.10.10-x64": {},
- "centos.7-x64": {},
- "rhel.7-x64": {},
- "debian.8.2-x64": {}
- }
-}
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly Types {}
-
-// class with public nullary ctor
-.class public auto ansi beforefieldinit ClassWithCtor
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends [mscorlib]System.Object
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends [mscorlib]System.Object
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_ClassConstraint_Pos {}
-
-
-
-.class public auto ansi beforefieldinit B
- extends [mscorlib]System.Object
-{
-
- // Generic method with class() constraint
- .method public hidebysig instance void
- method1<class T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit M_ClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]ClassWithCtor>()
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]ClassNoCtor>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]Delegate1>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [mscorlib]System.Object>()
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [mscorlib]System.ValueType>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]NonGenInterface>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]ClassWithCtor[]>()
-
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit M_ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]GenClassWithCtor<int32>>()
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]GenClassNoCtor<int32>>()
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class B::.ctor()
- call instance void class B::method1<class [types]GenInterface<int32>>()
-
- ret
- }
-
-
-}
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_ClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_ClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// POSITIVE TESTS
-/* Test various combinations of constraints on methods
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference tyoe
-default ctor, valuetype
-
-Test each constraint with
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-*/
-
-using System;
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string violatingType, string type)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
-
- Console.WriteLine(" : PASS");
- return;
- }
- catch (TypeLoadException e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e);
- pass = false;
- return;
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("POSITIVE TESTS");
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
-
- Check(new Case(M_DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor", "N/A", "N/A");
- Check(new Case(M_DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)", "N/A", "N/A");
- Check(new Case(M_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "N/A", "N/A");
-
- // enum is a valueypte and all valuetypes have public nullary ctors.
- Check(new Case(M_DefaultCtorConstraint.Test8), "Generic argument is an enum", "N/A", "N/A");
-
-
- Check(new Case(M_DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "N/A", "N/A");
- Check(new Case(M_DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct", "N/A", "N/A");
- Check(new Case(M_DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable<T>", "N/A", "N/A");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
-
-
- Check(new Case(M_ClassConstraint.Test1), "Generic argument is a class with default ctor", "N/A", "N/A");
- Check(new Case(M_ClassConstraint.Test2), "Generic argument is a class with no default ctor", "N/A", "N/A");
- Check(new Case(M_ClassConstraint.Test4), "Generic argument is a delegate", "N/A", "N/A");
- Check(new Case(M_ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "N/A", "N/A");
- Check(new Case(M_ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "N/A", "N/A");
- Check(new Case(M_ClassConstraint.Test7), "Generic argument is an interface", "N/A", "N/A");
-
-
- Check(new Case(M_ClassConstraint.Test9), "Generic argument is an array of classes with default ctor", "N/A", "N/A");
-
- Check(new Case(M_ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "N/A", "N/A");
- Check(new Case(M_ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "N/A", "N/A");
- Check(new Case(M_ClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "N/A", "N/A");
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
-
-
- Check(new Case(M_StructConstraint.Test3), "Generic argument is a struct", "N/A", "N/A");
- Check(new Case(M_StructConstraint.Test8), "Generic argument is an enum", "N/A", "N/A");
- Check(new Case(M_StructConstraint.Test9), "Generic argument is an mscorlib struct", "N/A", "N/A");
-
- Check(new Case(M_StructConstraintGenTypes.Test3), "Generic argument is a generic struct", "N/A", "N/A");
- Check(new Case(M_StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "N/A", "N/A");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
-
- Check(new Case(M_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor", "N/A", "N/A");
- Check(new Case(M_DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor", "N/A", "N/A");
- Check(new Case(M_DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "N/A", "N/A");
-
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
-
-
- Check(new Case(M_DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct", "N/A", "N/A");
- Check(new Case(M_DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct", "N/A", "N/A");
- Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct", "N/A", "N/A");
- Check(new Case(M_DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "N/A", "N/A");
- Check(new Case(M_DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum", "N/A", "N/A");
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_Constraints_Positive</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_Constraints_Positive.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="Method_ClassConstraint_Pos.ilproj" />
- <ProjectReference Include="Method_DefaultCtorAndClassConstraint_Pos.ilproj" />
- <ProjectReference Include="Method_DefaultCtorAndStructConstraint_Pos.ilproj" />
- <ProjectReference Include="Method_DefaultCtorConstraint_Pos.ilproj" />
- <ProjectReference Include="Method_StructConstraint_Pos.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_DefaultCtorAndClassConstraint_Pos {}
-
-
-
-.class public auto ansi beforefieldinit D
- extends [mscorlib]System.Object
-{
-
- // Generic method with class() and new() constraints
- .method public hidebysig instance void
- method1<class .ctor T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]ClassWithCtor>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [mscorlib]System.Object>()
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class D::.ctor()
- call instance void class D::method1<class [types]GenClassWithCtor<int32>>()
-
- ret
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_DefaultCtorAndClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_DefaultCtorAndClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_DefaultCtorAndStructConstraint_Pos {}
-
-
-
-.class public auto ansi beforefieldinit E
- extends [mscorlib]System.Object
-{
-
- // Generic method with struct() and new() constraints
- .method public hidebysig instance void
- method1<valuetype .ctor T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<valuetype [types]NonGenStruct>()
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<valuetype [types]Enum1>()
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<valuetype [mscorlib]System.DateTime>()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<valuetype [types]GenStruct<int32>>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class E::.ctor()
- call instance void class E::method1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>()
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_DefaultCtorAndStructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_DefaultCtorAndStructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_DefaultCtorConstraint_Pos {}
-
-
-.class public auto ansi beforefieldinit A
- extends [mscorlib]System.Object
-{
-
- // Generic method with new() constraint
- .method public hidebysig instance void
- method1<.ctor T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]ClassWithCtor>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
- newobj instance void class A::.ctor()
- call instance void class A::method1<valuetype [types]NonGenStruct>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [mscorlib]System.Object>()
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<valuetype [types]Enum1>()
- ret
- }
-
-
-}
-
-.class public auto ansi beforefieldinit M_DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<class [types]GenClassWithCtor<int32>>()
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<valuetype [types]GenStruct<int32>>()
-
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class A::.ctor()
- call instance void class A::method1<valuetype [mscorlib]System.'Nullable`1'<int32>>()
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_DefaultCtorConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_DefaultCtorConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Method_StructConstraint_Pos {}
-
-
-
-.class public auto ansi beforefieldinit C
- extends [mscorlib]System.Object
-{
-
- // Generic method with class() constraint
- .method public hidebysig instance void
- method1<valuetype T>() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit M_StructConstraint
- extends [mscorlib]System.Object
-{
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<valuetype [types]NonGenStruct>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<valuetype [types]Enum1>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<valuetype [mscorlib]System.DateTime>()
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit M_StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<valuetype [types]GenStruct<int32>>()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class C::.ctor()
- call instance void class C::method1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>()
-
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Method_StructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Method_StructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-<?xml version = "1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
+++ /dev/null
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816",
- "System.Collections": "4.0.10",
- "System.Collections.NonGeneric": "4.0.1-rc2-23816",
- "System.Collections.Specialized": "4.0.1-rc2-23816",
- "System.ComponentModel": "4.0.1-rc2-23816",
- "System.Console": "4.0.0-rc2-23816",
- "System.Diagnostics.Process": "4.1.0-rc2-23816",
- "System.Globalization": "4.0.10",
- "System.Globalization.Calendars": "4.0.0",
- "System.IO": "4.0.10",
- "System.IO.FileSystem": "4.0.0",
- "System.IO.FileSystem.Primitives": "4.0.0",
- "System.Linq": "4.0.1-rc2-23816",
- "System.Linq.Queryable": "4.0.1-rc2-23816",
- "System.Reflection": "4.0.10",
- "System.Reflection.Primitives": "4.0.0",
- "System.Runtime": "4.1.0-rc2-23816",
- "System.Runtime.Extensions": "4.0.10",
- "System.Runtime.Handles": "4.0.0",
- "System.Runtime.InteropServices": "4.1.0-rc2-23816",
- "System.Runtime.Loader": "4.0.0-rc2-23816",
- "System.Text.Encoding": "4.0.10",
- "System.Threading": "4.0.10",
- "System.Threading.Thread": "4.0.0-rc2-23816",
- "System.Xml.ReaderWriter": "4.0.11-rc2-23816",
- "System.Xml.XDocument": "4.0.11-rc2-23816",
- "System.Xml.XmlDocument": "4.0.1-rc2-23816",
- "System.Xml.XmlSerializer": "4.0.11-rc2-23816"
- },
- "frameworks": {
- "dnxcore50": {}
- }
-}
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly Types {}
-
-// class with public nullary ctor
-.class public auto ansi beforefieldinit ClassWithCtor
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends [mscorlib]System.Object
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends [mscorlib]System.Object
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_ClassConstraint_Neg {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit B`1<class T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit ClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<valuetype [types]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<valuetype [types]Enum1>::.ctor()
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<valuetype [types]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-}
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_ClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_ClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with illegal parameter types by instantiating the types
-
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference type
-default ctor, valuetype
-
-Test each constraint with (whichever applies to negative tests)
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-
-
-
-*/
-
-using System;
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string violatingType, string type)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
- Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException");
- pass = false;
- }
- catch (TypeLoadException e)
- {
- // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2'
- // violates the constraint of type parameter '%3'.
-
- Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type);
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type )
- {
- if (
- !e.ToString().Contains("0") ||
- !e.ToString().Contains(violatingType) ||
- !e.ToString().Contains(type) ||
- !e.ToString().Contains("T"))
- {
- Console.WriteLine("Exception message is incorrect");
- pass = false;
- }
- else
- {
- Console.WriteLine("Caught expected exception");
- }
- }
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]");
- Check(new Case(DefaultCtorConstraint.Test4), "Generic argument is a delegate", "Delegate1", "A`1[T]");
- Check(new Case(DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]");
- Check(new Case(DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]");
- Check(new Case(DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]");
- Check(new Case(DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]");
- Check(new Case(DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(ClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "B`1[T]");
- Check(new Case(ClassConstraint.Test8), "Generic argument is an enum", "Enum1", "B`1[T]");
- Check(new Case(ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "GenStruct[System.Int32]", "B`1[T]");
- Check(new Case(ClassConstraintGenTypes.Test6), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "B`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(StructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "C`1[T]");
- Check(new Case(StructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "C`1[T]");
- Check(new Case(StructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "C`1[T]");
- Check(new Case(StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "C`1[T]");
- Check(new Case(StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "C`1[T]");
- Check(new Case(StructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "C`1[T]");
- Check(new Case(StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "C`1[T]");
- Check(new Case(StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "C`1[T]");
- Check(new Case(StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "C`1[T]");
- Check(new Case(StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "C`1[T]");
- Check(new Case(StructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "C`1[T]");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "Delegate1", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "System.DateTime", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "Enum1", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]", "D`1[T]");
- Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "D`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "NonGenStruct[]", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]");
- Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "E`1[T]");
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_Constraints_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_Constraints_Neg.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="Instantiation_ClassConstraint_Neg.ilproj" />
- <ProjectReference Include="Instantiation_DefaultCtorAndClassConstraint_Neg.ilproj" />
- <ProjectReference Include="Instantiation_DefaultCtorAndStructConstraint_Neg.ilproj" />
- <ProjectReference Include="Instantiation_DefaultCtorConstraint_Neg.ilproj" />
- <ProjectReference Include="Instantiation_StructConstraint_Neg.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_DefaultCtorAndClassConstraint_Neg {}
-
-
-// Generic class with class() and new() constraints
-.class public auto ansi beforefieldinit D`1<class .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]ClassNoCtor>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [types]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- newobj instance void class D`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [types]Enum1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [mscorlib]System.DateTime>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a generic struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [types]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an generic interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorAndClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorAndClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI_extendC {}
-
-.assembly Instantiation_DefaultCtorAndClassTypeConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit F`1<.ctor ([types_implementI_extendC]C) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-
-
-.class public auto ansi beforefieldinit Instantiation_DefaultCtorAndClassTypeConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with default ctor that doesn't extend C
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassNoCtor>::.ctor()
- pop
-
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum (has default ctor since it's a valuetype)
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [types_implementI_extendC]Enum1>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test11() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a generic class with default ctor that implements I but doesn't extend C
- .method public hidebysig static void Test12() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test13() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [types_implementI_extendC]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test14() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [types_implementI_extendC]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
-
-
-
-
-
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorAndClassTypeConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorAndClassTypeConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="types_implementI_extendC.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_DefaultCtorAndStructConstraint_Neg {}
-
-
-// Generic class with struct() and new() constraints
-.class public auto ansi beforefieldinit E`1<valuetype .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types]ClassNoCtor>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- newobj instance void class E`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [types]NonGenStruct[]>::.ctor()
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorAndStructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorAndStructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_DefaultCtorConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]ClassNoCtor>::.ctor()
- pop
-
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-
- // generic argument is NUllable<T>
- .method public hidebysig static void Test10<M>() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<!!M>::.ctor()
- pop
-
- ret
- }
-
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_StructConstraint_Neg {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit C`1<valuetype T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit StructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]ClassNoCtor>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]Delegate1>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- newobj instance void class C`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<class [types]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_StructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_StructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI{}
-
-.assembly Interface_DefaultCtorAndClassConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit D`1<class .ctor ([types_implementI]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]ClassNoCtor>::.ctor()
- pop
-
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum (has default ctor since it's a valuetype)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [types_implementI]Enum1>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test11() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [types_implementI]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test12() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<valuetype [types_implementI]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorAndClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorAndClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI_extendC {}
-
-.assembly Interface_DefaultCtorAndClassTypeConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit F`1<class .ctor ([types_implementI_extendC]C, [types_implementI_extendC]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassTypeConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with default ctor that implements I but doesn't extend C
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassNoCtor>::.ctor()
- pop
-
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum (has default ctor since it's a valuetype)
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [types_implementI_extendC]Enum1>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test11() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a generic class with default ctor that implements I but doesn't extend C
- .method public hidebysig static void Test12() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test13() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [types_implementI_extendC]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test14() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<valuetype [types_implementI_extendC]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a class with default ctor that doesn't implements I but extends C
- .method public hidebysig static void Test15() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor2>::.ctor()
- pop
-
- ret
- }
-
-
-
-
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorAndClassTypeConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorAndClassTypeConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="types_implementI_extendC.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI{}
-
-.assembly Interface_DefaultCtorAndStructConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit E`1<valuetype .ctor ([types_implementI]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
-
-
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]ClassNoCtor>::.ctor()
- pop
-
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum (has default ctor since it's a valuetype)
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [types_implementI]Enum1>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test11() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test12() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<class [types_implementI]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorAndStructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorAndStructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI{}
-
-.assembly Interface_DefaultCtorConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor ([types_implementI]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]ClassNoCtor>::.ctor()
- pop
-
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum (has default ctor since it's a valuetype)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [types_implementI]Enum1>::.ctor()
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-
-
-// NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib {}
-.assembly extern TypeParam_Constraints_Neg {}
-.assembly RunTestNeg {}
-
-
-.class public auto ansi beforefieldinit GClass`2<(!U) T,class U>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit GStruct`2<(!U) T, valuetype U>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class public auto ansi beforefieldinit GNew`2<(!U) T,.ctor U>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit GClassType`2<(!U) T,([TypeParam_Constraints_Neg]A) U>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit GInterfaceType`2<(!U) T,([TypeParam_Constraints_Neg]I) U>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// ===============================================================================
-
-.class public auto ansi beforefieldinit RunGClassTest
- extends [mscorlib]System.Object
-{
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
- newobj instance void class GClass`2<class [TypeParam_Constraints_Neg]A,class [TypeParam_Constraints_Neg]B>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
- newobj instance void class GClass`2<class [TypeParam_Constraints_Neg]I,class [TypeParam_Constraints_Neg]C>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
- newobj instance void class GClass`2<object,class [TypeParam_Constraints_Neg]A[]>::.ctor()
- pop
- ret
- }
-
-
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
- newobj instance void class GClass`2<object,class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
- newobj instance void class GClass`2<int32,int32>::.ctor()
- pop
- ret
- }
-}
-
-// ===============================================================================
-
-.class public auto ansi beforefieldinit RunGStructTest
- extends [mscorlib]System.Object
-{
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
- newobj instance void class GStruct`2<class [TypeParam_Constraints_Neg]A,class [TypeParam_Constraints_Neg]B>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
- newobj instance void class GStruct`2<class [TypeParam_Constraints_Neg]I,class [TypeParam_Constraints_Neg]C>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
- newobj instance void class GStruct`2<object,valuetype [TypeParam_Constraints_Neg]S>::.ctor()
- pop
- ret
- }
-
-
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
- newobj instance void class GStruct`2<valuetype [TypeParam_Constraints_Neg]S,class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
- newobj instance void class GStruct`2<int32,object>::.ctor()
- pop
- ret
- }
-
-}
-
-// ===============================================================================
-
-
-.class public auto ansi beforefieldinit RunGNewTest
- extends [mscorlib]System.Object
-{
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
- newobj instance void class GNew`2<valuetype [TypeParam_Constraints_Neg]Enum1, class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
- newobj instance void class GNew`2<class [TypeParam_Constraints_Neg]C, class [TypeParam_Constraints_Neg] I>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
- newobj instance void class GNew`2<class [TypeParam_Constraints_Neg]A[],class [TypeParam_Constraints_Neg]A[]>::.ctor()
- pop
- ret
- }
-
-
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
- newobj instance void class GNew`2<object, class [TypeParam_Constraints_Neg]A>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
- newobj instance void class GNew`2<int32,class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-}
-
-// ===============================================================================
-
-.class public auto ansi beforefieldinit RunGClassTypeTest
- extends [mscorlib]System.Object
-{
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
- newobj instance void class GClassType`2<class [mscorlib]System.String, class [mscorlib]System.Object>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
- newobj instance void class GClassType`2<class [TypeParam_Constraints_Neg]A, class [mscorlib]System.Object>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
- newobj instance void class GClassType`2<class [TypeParam_Constraints_Neg]A[],class [TypeParam_Constraints_Neg]A[]>::.ctor()
- pop
- ret
- }
-
-
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
- newobj instance void class GClassType`2<object, class [TypeParam_Constraints_Neg]A>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
- newobj instance void class GClassType`2<int32,int32>::.ctor()
- pop
- ret
- }
-
-}
-
-// ===============================================================================
-
-.class public auto ansi beforefieldinit RunGInterfaceTypeTest
- extends [mscorlib]System.Object
-{
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
- newobj instance void class GInterfaceType`2<class [mscorlib]System.String, class [mscorlib]System.Object>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
- newobj instance void class GInterfaceType`2<class [TypeParam_Constraints_Neg]I, object>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
- newobj instance void class GInterfaceType`2<class [TypeParam_Constraints_Neg]I[],class [TypeParam_Constraints_Neg]I[]>::.ctor()
- pop
- ret
- }
-
-
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
- newobj instance void class GInterfaceType`2<object, class [TypeParam_Constraints_Neg]I>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
- newobj instance void class GInterfaceType`2<int32,int32>::.ctor()
- pop
- ret
- }
-
-}
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>RunTestNeg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="RunTestNeg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="TypeParam_Constraints_Neg.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-// See test descriptions below
-
-.assembly extern mscorlib {}
-
-.assembly RunTestNeg2 {}
-
-
-.class public auto ansi beforefieldinit A
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public sequential ansi sealed beforefieldinit S
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-
-
-
-.class interface public abstract auto ansi I {}
-
-
-
-.class private auto ansi beforefieldinit GClass`1<class T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit GStruct`1<valuetype T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class public auto ansi beforefieldinit GNew`1<.ctor T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// ============================================================
-
-
-.class private auto ansi beforefieldinit G1`1<valuetype P>
- extends class GClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class private auto ansi beforefieldinit G2`1<(I) P>
- extends class GClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G3`1<([mscorlib]System.Object) P>
- extends class GClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G4`1<([mscorlib]System.ValueType) P>
- extends class GClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class private auto ansi beforefieldinit G5`1<([mscorlib]System.Enum) P>
- extends class GClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
- // ============================================================
-
-
-.class private auto ansi beforefieldinit G6`1<class P>
- extends class GStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G7`1<(A) P>
- extends class GStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class private auto ansi beforefieldinit G8`1<(I) P>
- extends class GStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G12`1<(System.ValueType) P>
- extends class GStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G13`1<(valuetype [mscorlib]System.'Nullable`1'<int32>) P>
- extends class GStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
- // ============================================================
-
-.class public auto ansi beforefieldinit G9`1<(A) P>
- extends class GNew`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit G10`1<class P>
- extends class GNew`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit G11`1<(I) P>
- extends class GNew`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
- // ============================================================
-
-.class public auto ansi beforefieldinit RunTest
- extends [mscorlib]System.Object
-{
-
- // TEST 1
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has 'struct' constraint
- // use a class as type param
- .method public hidebysig static void Test1() cil managed
- {
-
- .maxstack 1
- newobj instance void class G1`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 2
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has 'struct' constraint
- // use a struct as type param
- .method public hidebysig static void Test2() cil managed
- {
-
- .maxstack 1
- newobj instance void class G1`1<valuetype S>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 3
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has interface-type constraint
- // This is a secondary constraint - this tells us nothing about the eventual instantiation that
- // we can use here.
-
- .method public hidebysig static void Test3() cil managed
- {
-
- .maxstack 1
- newobj instance void class G2`1<class I>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 4
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has System.Object constraint
- .method public hidebysig static void Test4() cil managed
- {
-
- .maxstack 1
- newobj instance void class G3`1<object>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 5
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has System.ValueType constraint
- .method public hidebysig static void Test5() cil managed
- {
-
- .maxstack 1
- newobj instance void class G4`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 6
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has System.Enum constraint
- .method public hidebysig static void Test6() cil managed
- {
-
- .maxstack 1
- newobj instance void class G5`1<class [mscorlib]System.Enum>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 7
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'class' constraint
- // instantiated with a class
- .method public hidebysig static void Test7() cil managed
- {
-
- .maxstack 1
- newobj instance void class G6`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 8
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'class' constraint
- // instantiated with a struct
- .method public hidebysig static void Test8() cil managed
- {
-
- .maxstack 1
- newobj instance void class G6`1<valuetype S>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 9
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'class-type' constraint
- .method public hidebysig static void Test9() cil managed
- {
-
- .maxstack 1
- newobj instance void class G7`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 10
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'interface-type' constraint
- .method public hidebysig static void Test10() cil managed
- {
-
- .maxstack 1
- newobj instance void class G8`1<class I>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 11
- // NEGATIVE
- // T has 'new' constraint BUT
- // P has 'class-type' constraint
- // Since constraints are not inherited this is a negative test because P doesn't have new constraint
- // and since not all reference types have default ctor we do not accept this constraint.
- .method public hidebysig static void Test11() cil managed
- {
-
- .maxstack 1
- newobj instance void class G9`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 12
- // NEGATIVE
- // T has 'new' constraint BUT
- // P has 'class' constraint
- .method public hidebysig static void Test12() cil managed
- {
-
- .maxstack 1
- newobj instance void class G10`1<class A>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 13
- // NEGATIVE
- // T has 'new' constraint BUT
- // P has 'interface-type' constraint
- .method public hidebysig static void Test13() cil managed
- {
-
- .maxstack 1
- newobj instance void class G11`1<class I>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 14
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'System.ValueType' constraint
- .method public hidebysig static void Test14() cil managed
- {
-
- .maxstack 1
- newobj instance void class G12`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 15
- // NEGATIVE
- // T has 'struct'Nullable<int>' constraint
- .method public hidebysig static void Test15() cil managed
- {
-
- .maxstack 1
- newobj instance void class G12`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
- ret
- }
-
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>RunTestNeg2</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="RunTestNeg2.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-// See test descriptions below
-
-.assembly extern mscorlib {}
-
-.assembly RunTestNeg3 {}
-
-
-.class public auto ansi beforefieldinit A
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public sequential ansi sealed beforefieldinit S
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-
-
-
-.class interface public abstract auto ansi I {}
-
-
-
-.class interface public abstract auto ansi IClass`1<class T> {}
-
-.class interface public abstract auto ansi IStruct`1<valuetype T> {}
-
-.class interface public abstract auto ansi INew`1<.ctor T> {}
-
-// ============================================================
-
-
-.class private auto ansi beforefieldinit G1`1<valuetype P>
- extends [mscorlib]System.Object
- implements class IClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class private auto ansi beforefieldinit G2`1<(I) P>
- extends [mscorlib]System.Object
- implements class IClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G3`1<([mscorlib]System.Object) P>
- extends [mscorlib]System.Object
- implements class IClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G4`1<([mscorlib]System.ValueType) P>
- extends [mscorlib]System.Object
- implements class IClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class private auto ansi beforefieldinit G5`1<([mscorlib]System.Enum) P>
- extends [mscorlib]System.Object
- implements class IClass`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
- // ============================================================
-
-.class private auto ansi beforefieldinit G6`1<class P>
- extends [mscorlib]System.Object
- implements class IStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G7`1<(A) P>
- extends [mscorlib]System.Object
- implements class IStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class private auto ansi beforefieldinit G8`1<(I) P>
- extends [mscorlib]System.Object
- implements class IStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-.class private auto ansi beforefieldinit G12`1<(System.ValueType) P>
- extends [mscorlib]System.Object
- implements class IStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class private auto ansi beforefieldinit G13`1<(valuetype [mscorlib]System.'Nullable`1'<int32>) P>
- extends [mscorlib]System.Object
- implements class IStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
- // ============================================================
-
-.class public auto ansi beforefieldinit G9`1<(A) P>
- extends [mscorlib]System.Object
- implements class INew`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit G10`1<class P>
- extends [mscorlib]System.Object
- implements class INew`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit G11`1<(I) P>
- extends [mscorlib]System.Object
- implements class INew`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-
- // ============================================================
-
-.class public auto ansi beforefieldinit RunTest
- extends [mscorlib]System.Object
-{
-
- // TEST 1
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has 'struct' constraint
- // use a class as type param
- .method public hidebysig static void Test1() cil managed
- {
-
- .maxstack 1
- newobj instance void class G1`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 2
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has 'struct' constraint
- // use a struct as type param
- .method public hidebysig static void Test2() cil managed
- {
-
- .maxstack 1
- newobj instance void class G1`1<valuetype S>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 3
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has interface-type constraint
- // This is a secondary constraint - this tells us nothing about the eventual instantiation that
- // we can use here.
-
- .method public hidebysig static void Test3() cil managed
- {
-
- .maxstack 1
- newobj instance void class G2`1<class I>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 4
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has System.Object constraint
- .method public hidebysig static void Test4() cil managed
- {
-
- .maxstack 1
- newobj instance void class G3`1<object>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 5
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has System.ValueType constraint
- .method public hidebysig static void Test5() cil managed
- {
-
- .maxstack 1
- newobj instance void class G4`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 6
- // NEGATIVE
- // T has 'class' constraint BUT
- // P has System.Enum constraint
- .method public hidebysig static void Test6() cil managed
- {
-
- .maxstack 1
- newobj instance void class G5`1<class [mscorlib]System.Enum>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 7
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'class' constraint
- // instantiated with a class
- .method public hidebysig static void Test7() cil managed
- {
-
- .maxstack 1
- newobj instance void class G6`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 8
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'class' constraint
- // instantiated with a struct
- .method public hidebysig static void Test8() cil managed
- {
-
- .maxstack 1
- newobj instance void class G6`1<valuetype S>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 9
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'class-type' constraint
- .method public hidebysig static void Test9() cil managed
- {
-
- .maxstack 1
- newobj instance void class G7`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 10
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'interface-type' constraint
- .method public hidebysig static void Test10() cil managed
- {
-
- .maxstack 1
- newobj instance void class G8`1<class I>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 11
- // NEGATIVE
- // T has 'new' constraint BUT
- // P has 'class-type' constraint
- // Since constraints are not inherited this is a negative test because P doesn't have new constraint
- // and since not all reference types have default ctor we do not accept this constraint.
- .method public hidebysig static void Test11() cil managed
- {
-
- .maxstack 1
- newobj instance void class G9`1<class A>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 12
- // NEGATIVE
- // T has 'new' constraint BUT
- // P has 'class' constraint
- .method public hidebysig static void Test12() cil managed
- {
-
- .maxstack 1
- newobj instance void class G10`1<class A>::.ctor()
- pop
- ret
- }
-
-
- // =====================================================================
-
- // TEST 13
- // NEGATIVE
- // T has 'new' constraint BUT
- // P has 'interface-type' constraint
- .method public hidebysig static void Test13() cil managed
- {
-
- .maxstack 1
- newobj instance void class G11`1<class I>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 14
- // NEGATIVE
- // T has 'struct' constraint BUT
- // P has 'System.ValueType' constraint
- .method public hidebysig static void Test14() cil managed
- {
-
- .maxstack 1
- newobj instance void class G12`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
- // =====================================================================
-
- // TEST 15
- // NEGATIVE
- // T has 'struct'Nullable<int>' constraint
- .method public hidebysig static void Test15() cil managed
- {
-
- .maxstack 1
- newobj instance void class G12`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
- ret
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>RunTestNeg3</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="RunTestNeg3.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-// NEGATIVE TESTS
-/*
-
-The following constraint combinations are tested:
-
-- Interface-type, New()
-- class, Interface-type, New()
-- struct, Interface-type, New()
-- Class-type, Interface-type, New()
-- Class-type, New()
-
-
-Each is tested with type parameter (whichever is valid in negative tests):
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-*/
-
-using System;
-using System.Security;
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string violatingType, string type)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
- Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException");
- pass = false;
- }
- catch (TypeLoadException e)
- {
- // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2'
- // violates the constraint of type parameter '%3'.
-
- Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type);
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type )
- {
- if (
- !e.ToString().Contains("0") ||
- !e.ToString().Contains(violatingType) ||
- !e.ToString().Contains(type) ||
- !e.ToString().Contains("T"))
- {
- Console.WriteLine("Exception message is incorrect");
- pass = false;
- }
- else
- {
- Console.WriteLine("Caught expected exception");
- }
- }
-
-
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Console.WriteLine("\nType: A<T> where T : I, new()\n");
-
-
- Check(new Case(Interface_DefaultCtorConstraint.Test1), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]");
- Check(new Case(Interface_DefaultCtorConstraint .Test2), "Generic argument is an mscorlib class with default ctor", "System.Object", "A`1[T]");
- Check(new Case(Interface_DefaultCtorConstraint.Test3), "Generic argument is a delegate", "Delegate1", "A`1[T]");
- Check(new Case(Interface_DefaultCtorConstraint .Test4), "Generic argument is an enum", "Enum1", "A`1[T]");
- Check(new Case(Interface_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]");
- Check(new Case(Interface_DefaultCtorConstraint.Test6), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]");
-
- Check(new Case(Interface_DefaultCtorConstraint.Test7), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]");
-
- Check(new Case(Interface_DefaultCtorConstraint.Test8), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]");
- Check(new Case(Interface_DefaultCtorConstraint.Test9), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]");
- Check(new Case(Interface_DefaultCtorConstraint.Test10), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "A`1[T]");
-
- Console.WriteLine("\nType: A<T> where T : class, I, new() \n");
-
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test2), "Generic argument is an mscorlib class with default ctor", "System.Object", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test3), "Generic argument is a delegate", "Delegate1", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test4), "Generic argument is an enum", "Enum1", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test5), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test6), "Generic argument is an interface with no default ctor", "NonGenInterface", "D`1[T]");
-
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test7), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]");
-
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test8), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test9), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test10), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "D`1[T]");
-
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test11), "Generic argument is a struct", "NonGenStruct", "D`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassConstraint.Test12), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : struct, I, new()\n");
-
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test3), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test5), "Generic argument is an enum", "Enum1", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test8), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test9), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test10), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test11), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "E`1[T]");
- Check(new Case(Interface_DefaultCtorAndStructConstraint.Test12), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : C, I, new()\n");
-
-
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test1), "Generic argument is a class with default ctor, implements I, doesn't extend C", "ClassWithCtor", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test15), "Generic argument is a class with default ctor, doesn't implement I but extends C", "ClassWithCtor2", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test3), "Generic argument is an mscorlib class with default ctor", "System.Object", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test4), "Generic argument is a delegate", "Delegate1", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test5), "Generic argument is an enum", "Enum1", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test8), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test9), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test10), "Generic argument is a generic interface", "GenInterface[System.Int32]", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test11), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test12), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test13), "Generic argument is a struct", "NonGenStruct", "F`1[T]");
- Check(new Case(Interface_DefaultCtorAndClassTypeConstraint.Test14), "Generic argument is a generic struct", "GenStruct[System.Int32]", "F`1[T]");
-
-
-
- Console.WriteLine("\nType: A<T> where T : C, new()\n");
-
-
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test1), "Generic argument is a class with default ctor, implements I, doesn't extend C", "ClassWithCtor", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test3), "Generic argument is an mscorlib class with default ctor", "System.Object", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test4), "Generic argument is a delegate", "Delegate1", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test5), "Generic argument is an enum", "Enum1", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test8), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test9), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test10), "Generic argument is a generic interface", "GenInterface[System.Int32]", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test11), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test12), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test13), "Generic argument is a struct", "NonGenStruct", "F`1[T]");
- Check(new Case(Instantiation_DefaultCtorAndClassTypeConstraint.Test14), "Generic argument is a generic struct", "GenStruct[System.Int32]", "F`1[T]");
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Secondary_Ctor_Constraints_Type_Negative</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Secondary_Ctor_Constraints_Type_Negative.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="Interface_DefaultCtorAndClassConstraint_Neg.ilproj" />
- <ProjectReference Include="Interface_DefaultCtorConstraint_Neg.ilproj" />
- <ProjectReference Include="Interface_DefaultCtorAndStructConstraint_Neg.ilproj" />
- <ProjectReference Include="Interface_DefaultCtorAndClassTypeConstraint_Neg.ilproj" />
- <ProjectReference Include="Instantiation_DefaultCtorAndClassTypeConstraint_Neg.ilproj" />
- <ProjectReference Include="types_implementI.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_ClassConstraint_Neg {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit B`1<class T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_ClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<valuetype [types]NonGenStruct>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<valuetype [types]Enum1>::i
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<valuetype [types]GenStruct<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::i
- pop
-
- ret
- }
-}
-
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_ClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_ClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with illegal parameter types accessing static field of the generic type
-
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference tyoe
-default ctor, valuetype
-
-Test each constraint with (whichever applies to negative tests)
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-
-*/
-
-using System;
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string violatingType, string type)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
- Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException");
- pass = false;
- }
- catch (TypeLoadException e)
- {
- // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2'
- // violates the constraint of type parameter '%3'.
-
- Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type);
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type )
- {
- if (
- !e.ToString().Contains("0") ||
- !e.ToString().Contains(violatingType) ||
- !e.ToString().Contains(type) ||
- !e.ToString().Contains("T"))
- {
- Console.WriteLine("Exception message is incorrect");
- pass = false;
- }
- else
- {
- Console.WriteLine("Caught expected exception");
- }
- }
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SF_DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]");
- Check(new Case(SF_DefaultCtorConstraint.Test4), "Generic argument is a delegate", "Delegate1", "A`1[T]");
- Check(new Case(SF_DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]");
- Check(new Case(SF_DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]");
- Check(new Case(SF_DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]");
- Check(new Case(SF_DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]");
- Check(new Case(SF_DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SF_ClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "B`1[T]");
- Check(new Case(SF_ClassConstraint.Test8), "Generic argument is an enum", "Enum1", "B`1[T]");
- Check(new Case(SF_ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "GenStruct[System.Int32]", "B`1[T]");
- Check(new Case(SF_ClassConstraintGenTypes.Test6), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "B`1[T]");
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SF_StructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "C`1[T]");
- Check(new Case(SF_StructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "C`1[T]");
- Check(new Case(SF_StructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "C`1[T]");
- Check(new Case(SF_StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "C`1[T]");
- Check(new Case(SF_StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "C`1[T]");
- Check(new Case(SF_StructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "C`1[T]");
- Check(new Case(SF_StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "C`1[T]");
-
- Check(new Case(SF_StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "C`1[T]");
- Check(new Case(SF_StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "C`1[T]");
- Check(new Case(SF_StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "C`1[T]");
- Check(new Case(SF_StructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "C`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "Delegate1", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "System.DateTime", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "Enum1", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]");
-
-
- Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]", "D`1[T]");
- Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "D`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]");
-
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "NonGenStruct[]", "E`1[T]");
-
-
- Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]");
- Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "E`1[T]");
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_Constraints_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_Constraints_Neg.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="StaticField_ClassConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticField_DefaultCtorAndClassConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticField_DefaultCtorAndStructConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticField_DefaultCtorConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticField_StructConstraint_Neg.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_DefaultCtorAndClassConstraint_Neg {}
-
-
-// Generic class with class() and new() constraints
-.class public auto ansi beforefieldinit D`1<class .ctor T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]ClassNoCtor>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<valuetype [types]NonGenStruct>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]Delegate1>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- ldsfld int32 class D`1<class [mscorlib]System.ValueType>::i
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]NonGenInterface>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<valuetype [types]Enum1>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<valuetype [mscorlib]System.DateTime>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]ClassWithCtor[]>::i
- pop
-
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]GenClassNoCtor<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a generic struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<valuetype [types]GenStruct<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an generic interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]GenInterface<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- ldsfld int32 class D`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::i
-
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::i
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_DefaultCtorAndClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_DefaultCtorAndClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_DefaultCtorAndStructConstraint_Neg {}
-
-
-// Generic class with struct() and new() constraints
-.class public auto ansi beforefieldinit E`1<valuetype .ctor T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [types]ClassWithCtor>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [types]ClassNoCtor>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [types]Delegate1>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [mscorlib]System.Object>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- ldsfld int32 class E`1<class [mscorlib]System.ValueType>::i
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [types]NonGenInterface>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<valuetype [types]NonGenStruct[]>::i
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [types]GenClassWithCtor<int32>>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [types]GenClassNoCtor<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<class [types]GenInterface<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::i
- pop
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_DefaultCtorAndStructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_DefaultCtorAndStructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_DefaultCtorConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]ClassNoCtor>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]Delegate1>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [mscorlib]System.ValueType>::i
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]NonGenInterface>::i
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]ClassWithCtor[]>::i
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]GenClassNoCtor<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]GenInterface<int32>>::i
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_DefaultCtorConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_DefaultCtorConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_StructConstraint_Neg {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit C`1<valuetype T>
- extends [mscorlib]System.Object
-{
- .field public static int32 i
-
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_StructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]ClassWithCtor>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]ClassNoCtor>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]Delegate1>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [mscorlib]System.Object>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- ldsfld int32 class C`1<class [mscorlib]System.ValueType>::i
- pop
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]NonGenInterface>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]ClassWithCtor[]>::i
- pop
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]GenClassWithCtor<int32>>::i
- pop
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]GenClassNoCtor<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<class [types]GenInterface<int32>>::i
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::i
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_StructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_StructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_ClassConstraint_Neg {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit B`1<class T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_ClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class B`1<valuetype [types]NonGenStruct>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- call void class B`1<valuetype [types]Enum1>::method1()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class B`1<valuetype [types]GenStruct<int32>>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- call void class B`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::method1()
- ret
- }
-}
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_ClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_ClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with illegal parameter types by invoking static method on the generic type
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference tyoe
-default ctor, valuetype
-
-Test each constraint with (whichever applies to negative testing)
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-*/
-
-using System;
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string violatingType, string type)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
- Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException");
- pass = false;
- }
- catch (TypeLoadException e)
- {
- // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2'
- // violates the constraint of type parameter '%3'.
-
- Test.CheckTypeLoadExceptionMessage(8310, e, violatingType, type);
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static void CheckTypeLoadExceptionMessage(uint ResourceID, TypeLoadException e, string violatingType, string type )
- {
- if (
- !e.ToString().Contains("0") ||
- !e.ToString().Contains(violatingType) ||
- !e.ToString().Contains(type) ||
- !e.ToString().Contains("T"))
- {
- Console.WriteLine("Exception message is incorrect");
- pass = false;
- }
- else
- {
- Console.WriteLine("Caught expected exception");
- }
- }
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SM_DefaultCtorConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "A`1[T]");
- Check(new Case(SM_DefaultCtorConstraint.Test4), "Generic argument is a delegate", "Delegate1", "A`1[T]");
- Check(new Case(SM_DefaultCtorConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "A`1[T]");
- Check(new Case(SM_DefaultCtorConstraint.Test7), "Generic argument is an interface with no default ctor", "NonGenInterface", "A`1[T]");
- Check(new Case(SM_DefaultCtorConstraint.Test9), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "A`1[T]");
- Check(new Case(SM_DefaultCtorConstraintGenTypes.Test2), " Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "A`1[T]");
- Check(new Case(SM_DefaultCtorConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "A`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SM_ClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "B`1[T]");
- Check(new Case(SM_ClassConstraint.Test8), "Generic argument is an enum", "Enum1", "B`1[T]");
- Check(new Case(SM_ClassConstraintGenTypes.Test3), "Generic argument is a generic struct with default ctor", "GenStruct[System.Int32]", "B`1[T]");
- Check(new Case(SM_ClassConstraintGenTypes.Test6), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "B`1[T]");
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SM_StructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "C`1[T]");
- Check(new Case(SM_StructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "C`1[T]");
- Check(new Case(SM_StructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "C`1[T]");
- Check(new Case(SM_StructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "C`1[T]");
- Check(new Case(SM_StructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "C`1[T]");
- Check(new Case(SM_StructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "C`1[T]");
- Check(new Case(SM_StructConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "C`1[T]");
- Check(new Case(SM_StructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "C`1[T]");
- Check(new Case(SM_StructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "C`1[T]");
- Check(new Case(SM_StructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "C`1[T]");
- Check(new Case(SM_StructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "C`1[T]");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test3), "Generic argument is a struct", "NonGenStruct", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test4), "Generic argument is a delegate", "Delegate1", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test9), "Generic argument is an mscorlib struct", "System.DateTime", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test8), "Generic argument is an enum", "Enum1", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test10), "Generic argument is an array of classes with default ctor", "ClassWithCtor[]", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test3), "Generic argument is a generic struct", "GenStruct[System.Int32]", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct", "System.Collections.Generic.KeyValuePair`2[NonGenStruct,System.Int32]", "D`1[T]");
- Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "D`1[T]");
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
- Console.WriteLine("\nNEGATIVE TESTS");
-
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test1), "Generic argument is a class with default ctor", "ClassWithCtor", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test2), "Generic argument is a class with no default ctor", "ClassNoCtor", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test4), "Generic argument is a delegate", "Delegate1", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test5), "Generic argument is an mscorlib class with default ctor", "System.Object", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor", "System.ValueType", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test7), "Generic argument is an interface", "NonGenInterface", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test10), "Generic argument is an array of classes with default ctor", "NonGenStruct[]", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor", "GenClassWithCtor[System.Int32]", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor", "GenClassNoCtor[System.Int32]", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test5), "Generic argument is a generic interface", "GenInterface[System.Int32]", "E`1[T]");
- Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test7), "Generic argument is Nullable<T>", "System.Nullable`1[System.Int32]", "E`1[T]");
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_Constraints_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_Constraints_Neg.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="StaticMethod_ClassConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticMethod_DefaultCtorAndClassConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticMethod_DefaultCtorAndStructConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticMethod_DefaultCtorConstraint_Neg.ilproj" />
- <ProjectReference Include="StaticMethod_StructConstraint_Neg.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_DefaultCtorAndClassConstraint_Neg {}
-
-
-// Generic class with class() and new() constraints
-.class public auto ansi beforefieldinit D`1<class .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]ClassNoCtor>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class D`1<valuetype [types]NonGenStruct>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]Delegate1>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- call void class D`1<class [mscorlib]System.ValueType>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]NonGenInterface>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- call void class D`1<valuetype [types]Enum1>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- call void class D`1<valuetype [mscorlib]System.DateTime>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]ClassWithCtor[]>::method1()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]GenClassNoCtor<int32>>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a generic struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class D`1<valuetype [types]GenStruct<int32>>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an generic interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]GenInterface<int32>>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- call void class D`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::method1()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- call void class D`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::method1()
- ret
- }
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_DefaultCtorAndClassConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_DefaultCtorAndClassConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_DefaultCtorAndStructConstraint_Neg {}
-
-
-// Generic class with struct() and new() constraints
-.class public auto ansi beforefieldinit E`1<valuetype .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [types]ClassWithCtor>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [types]ClassNoCtor>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [types]Delegate1>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [mscorlib]System.Object>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- call void class E`1<class [mscorlib]System.ValueType>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [types]NonGenInterface>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- call void class E`1<valuetype [types]NonGenStruct[]>::method1()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [types]GenClassWithCtor<int32>>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [types]GenClassNoCtor<int32>>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class E`1<class [types]GenInterface<int32>>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- call void class E`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::method1()
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_DefaultCtorAndStructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_DefaultCtorAndStructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_DefaultCtorConstraint_Neg {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [types]ClassNoCtor>::method1()
-
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a delegate (doesn't have public parameterless constructor)
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
- call void class A`1<class [types]Delegate1>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [mscorlib]System.ValueType>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [types]NonGenInterface>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [types]ClassWithCtor[]>::method1()
-
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [types]GenClassNoCtor<int32>>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [types]GenInterface<int32>>::method1()
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_DefaultCtorConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_DefaultCtorConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_StructConstraint_Neg {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit C`1<valuetype T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_StructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]ClassWithCtor>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]ClassNoCtor>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]Delegate1>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [mscorlib]System.Object>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [mscorlib]System.ValueType>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]NonGenInterface>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test10() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]ClassWithCtor[]>::method1()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]GenClassWithCtor<int32>>::method1()
- ret
- }
-
- // NEGATIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]GenClassNoCtor<int32>>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class C`1<class [types]GenInterface<int32>>::method1()
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- call void class C`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::method1()
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_StructConstraint_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_StructConstraint_Neg.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with illegal parameter types by instantiating the type
-
-*/
-
-using System;
-
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string genArgNumber, string violatingType, string type, string typeParam)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
- Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException");
- pass = false;
- }
- catch (TypeLoadException e)
- {
- // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2'
- // violates the constraint of type parameter '%3'.
-
- Test.CheckTypeLoadExceptionMessage(8310, genArgNumber, e, violatingType, type, typeParam);
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static void CheckTypeLoadExceptionMessage(uint ResourceID, string genArgNumber, TypeLoadException e, string violatingType, string type, string typeParam )
- {
- if (
- !e.ToString().Contains(genArgNumber) ||
- !e.ToString().Contains(violatingType) ||
- !e.ToString().Contains(type) ||
- !e.ToString().Contains(typeParam))
- {
- Console.WriteLine("Exception message is incorrect");
- pass = false;
- }
- else
- {
- Console.WriteLine("Caught expected exception");
- }
- }
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: GClass<T> where T : class\n");
- Console.WriteLine("NEGATIVE TESTS");
-
- Check(new Case(RunTest.Test1), "class G1<P> : GClass<P> where P : struct {}, insantiate with class","0", "P", "GClass`1[T]", "T");
- Check(new Case(RunTest.Test2), "class G1<P> : GClass<P> where P : struct {}, instantiate with valuetype", "0", "P", "GClass`1[T]", "T");
- Check(new Case(RunTest.Test3), "class G2<P> : GClass<P> where P : I {}", "0", "P", "GClass`1[T]", "T");
- Check(new Case(RunTest.Test4), "class G3<P> : GClass<P> where P : System.Object {}", "0", "P", "GClass`1[T]", "T");
- Check(new Case(RunTest.Test5), "class G4<P> : GClass<P> where P : System.ValueType {}", "0", "P", "GClass`1[T]", "T");
- Check(new Case(RunTest.Test6), "class G5<P> : GClass<P> where P : System.Enum {}", "0", "P", "GClass`1[T]", "T");
-
-
- Console.WriteLine("\nType: GStruct<T> where T : struct\n");
- Console.WriteLine("NEGATIVE TESTS");
-
-
- Check(new Case(RunTest.Test7), "class G6<P> : IStruct<P> where P : class {}, insantiate with class","0", "P", "GStruct`1[T]", "T");
- Check(new Case(RunTest.Test8), "class G6<P> : IStruct<P> where P : class {}, instantiate with valuetype", "0", "P", "GStruct`1[T]", "T");
- Check(new Case(RunTest.Test9), "class G7<P> : IStruct<P> where P : A {}", "0", "P", "GStruct`1[T]", "T");
- Check(new Case(RunTest.Test10), "class G8<P> : IStruct<P> where P : I {}", "0", "P", "GStruct`1[T]", "T");
-
- Check(new Case(RunTest.Test14), "class G12<P> : IStruct<P> where P : System.ValueType {}", "0", "P", "GStruct`1[T]", "T");
- Check(new Case(RunTest.Test15), "class G12<P> : IStruct<P> where P : System.Nullable<int> {}", "0", "P", "GStruct`1[T]", "T");
-
-
- Console.WriteLine("\nType: GNew<T> where T : new() \n");
- Console.WriteLine("NEGATIVE TESTS");
-
-
- Check(new Case(RunTest.Test11), "class G9<P> : GNew<P> where P : A {}, insantiate with class","0", "P", "GNew`1[T]", "T");
- Check(new Case(RunTest.Test12), "class G10<P> : GNew<P> where P : class {}, instantiate with valuetype", "0", "P", "GNew`1[T]", "T");
- Check(new Case(RunTest.Test13), "class G11<P> : GNew<P> where P : I {}", "0", "P", "GNew`1[T]", "T");
-
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>TypeParam2_Constraints_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="TypeParam2_Constraints_Neg.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="RunTestNeg2.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with illegal parameter types by instantiating the type
- These tests are similar to TypeParam2* only here we have a generic interface I<T> with a constraint on T
- and in TypeParam2* we have a generic class G<T> with a constraint on T.
-*/
-
-using System;
-
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName, string genArgNumber, string violatingType, string type, string typeParam)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
- Console.WriteLine("\nFAIL: Did not catch expected TypeLoadException");
- pass = false;
- }
- catch (TypeLoadException e)
- {
- // Unhandled Exception: System.TypeLoadException: %0, '%1', on '%2'
- // violates the constraint of type parameter '%3'.
-
- Test.CheckTypeLoadExceptionMessage(8310, genArgNumber, e, violatingType, type, typeParam);
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static void CheckTypeLoadExceptionMessage(uint ResourceID, string genArgNumber, TypeLoadException e, string violatingType, string type, string typeParam )
- {
- if (
- !e.ToString().Contains(genArgNumber) ||
- !e.ToString().Contains(violatingType) ||
- !e.ToString().Contains(type) ||
- !e.ToString().Contains(typeParam))
- {
- Console.WriteLine("Exception message is incorrect");
- pass = false;
- }
- else
- {
- Console.WriteLine("Caught expected exception");
- }
- }
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: IClass<T> where T : class\n");
- Console.WriteLine("NEGATIVE TESTS");
-
- Check(new Case(RunTest.Test1), "class G1<P> : IClass<P> where P : struct {}, insantiate with class","0", "P", "IClass`1[T]", "T");
- Check(new Case(RunTest.Test2), "class G1<P> : IClass<P> where P : struct {}, instantiate with valuetype", "0", "P", "IClass`1[T]", "T");
- Check(new Case(RunTest.Test3), "class G2<P> : IClass<P> where P : I {}", "0", "P", "IClass`1[T]", "T");
- Check(new Case(RunTest.Test4), "class G3<P> : IClass<P> where P : System.Object {}", "0", "P", "IClass`1[T]", "T");
- Check(new Case(RunTest.Test5), "class G4<P> : IClass<P> where P : System.ValueType {}", "0", "P", "IClass`1[T]", "T");
- Check(new Case(RunTest.Test6), "class G5<P> : IClass<P> where P : System.Enum {}", "0", "P", "IClass`1[T]", "T");
-
-
- Console.WriteLine("\nType: IStruct<T> where T : struct\n");
- Console.WriteLine("NEGATIVE TESTS");
-
-
- Check(new Case(RunTest.Test7), "class G6<P> : IStruct<P> where P : class {}, insantiate with class","0", "P", "IStruct`1[T]", "T");
- Check(new Case(RunTest.Test8), "class G6<P> : IStruct<P> where P : class {}, instantiate with valuetype", "0", "P", "IStruct`1[T]", "T");
- Check(new Case(RunTest.Test9), "class G7<P> : IStruct<P> where P : A {}", "0", "P", "IStruct`1[T]", "T");
- Check(new Case(RunTest.Test10), "class G8<P> : IStruct<P> where P : I {}", "0", "P", "IStruct`1[T]", "T");
-
- Check(new Case(RunTest.Test14), "class G12<P> : IStruct<P> where P : System.ValueType {}", "0", "P", "IStruct`1[T]", "T");
- Check(new Case(RunTest.Test15), "class G12<P> : IStruct<P> where P : System.Nullable<int> {}", "0", "P", "IStruct`1[T]", "T");
-
-
-
- Console.WriteLine("\nType: INew<T> where T : new() \n");
- Console.WriteLine("NEGATIVE TESTS");
-
-
- Check(new Case(RunTest.Test11), "class G9<P> : INew<P> where P : A {}, insantiate with class","0", "P", "INew`1[T]", "T");
- Check(new Case(RunTest.Test12), "class G10<P> : INew<P> where P : class {}, instantiate with valuetype", "0", "P", "INew`1[T]", "T");
- Check(new Case(RunTest.Test13), "class G11<P> : INew<P> where P : I {}", "0", "P", "INew`1[T]", "T");
-
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>TypeParam3_Constraints_Neg</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="TypeParam3_Constraints_Neg.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="RunTestNeg3.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-<?xml version = "1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
+++ /dev/null
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816",
- "System.Collections": "4.0.10",
- "System.Collections.NonGeneric": "4.0.1-rc2-23816",
- "System.Collections.Specialized": "4.0.1-rc2-23816",
- "System.ComponentModel": "4.0.1-rc2-23816",
- "System.Console": "4.0.0-rc2-23816",
- "System.Diagnostics.Process": "4.1.0-rc2-23816",
- "System.Globalization": "4.0.10",
- "System.Globalization.Calendars": "4.0.0",
- "System.IO": "4.0.10",
- "System.IO.FileSystem": "4.0.0",
- "System.IO.FileSystem.Primitives": "4.0.0",
- "System.Linq": "4.0.1-rc2-23816",
- "System.Linq.Queryable": "4.0.1-rc2-23816",
- "System.Reflection": "4.0.10",
- "System.Reflection.Primitives": "4.0.0",
- "System.Runtime": "4.1.0-rc2-23816",
- "System.Runtime.Extensions": "4.0.10",
- "System.Runtime.Handles": "4.0.0",
- "System.Runtime.InteropServices": "4.1.0-rc2-23816",
- "System.Runtime.Loader": "4.0.0-rc2-23816",
- "System.Text.Encoding": "4.0.10",
- "System.Threading": "4.0.10",
- "System.Threading.Thread": "4.0.0-rc2-23816",
- "System.Xml.ReaderWriter": "4.0.11-rc2-23816",
- "System.Xml.XDocument": "4.0.11-rc2-23816",
- "System.Xml.XmlDocument": "4.0.1-rc2-23816",
- "System.Xml.XmlSerializer": "4.0.11-rc2-23816"
- },
- "frameworks": {
- "dnxcore50": {}
- }
-}
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly Types {}
-
-// class with public nullary ctor
-.class public auto ansi beforefieldinit ClassWithCtor
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends [mscorlib]System.Object
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends [mscorlib]System.Object
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly Types_implementI {}
-
-
-.class interface public abstract auto ansi I {}
-
-
-// class with public nullary ctor
-.class public auto ansi beforefieldinit ClassWithCtor
- extends [mscorlib]System.Object
- implements I
-
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends [mscorlib]System.Object
- implements I
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends [mscorlib]System.Object
- implements I
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends [mscorlib]System.Object
- implements I
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
- implements I
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
- implements I
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
- implements I
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types_implementI</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types_implementI.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly types_implementI_extendC {}
-
-
-.class interface public abstract auto ansi I {}
-
-.class public auto ansi beforefieldinit C
- extends [mscorlib]System.Object
-{}
-
-// class with public nullary ctor implements I but doesn't extend C
-.class public auto ansi beforefieldinit ClassWithCtor
- extends [mscorlib]System.Object
- implements I
-
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// class with public nullary ctor extends C but doesn't implement I
-.class public auto ansi beforefieldinit ClassWithCtor2
- extends C
-
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends [mscorlib]System.Object
- implements I
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends [mscorlib]System.Object
- implements I
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends [mscorlib]System.Object
- implements I
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
- implements I
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
- implements I
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
- implements I
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types_implementI_extendC</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types_implementI_extendC.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_ClassConstraint_Pos {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit B`1<class T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit ClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]ClassNoCtor>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]Delegate1>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- newobj instance void class B`1<class [mscorlib]System.ValueType>::.ctor()
- pop
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]NonGenInterface>::.ctor()
- pop
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]ClassWithCtor[]>::.ctor()
- pop
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]GenClassNoCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class B`1<class [types]GenInterface<int32>>::.ctor()
- pop
-
- ret
- }
-}
-
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_ClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_ClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with legal parameter types by instantiating the types
-
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference type
-default ctor, valuetype
-
-Test each constraint with (whatever applies for positive testing)
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-
-
-
-*/
-
-using System;
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
- static void Check(Case mytest, string testName)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
-
- Console.WriteLine(" : PASS");
- return;
- }
- catch (TypeLoadException e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e);
- pass = false;
- return;
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
-
- Console.WriteLine("POSITIVE TESTS");
- Check(new Case(DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)");
- Check(new Case(DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor");
- Check(new Case(DefaultCtorConstraint.Test8), "Generic argument is an enum");
- Check(new Case(DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
- Check(new Case(DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable<T>");
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
-
- Console.WriteLine("POSITIVE TESTS");
- Check(new Case(ClassConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(ClassConstraint.Test2), "Generic argument is a class with no default ctor");
- Check(new Case(ClassConstraint.Test4), "Generic argument is a delegate");
- Check(new Case(ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor");
- Check(new Case(ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor");
- Check(new Case(ClassConstraint.Test7), "Generic argument is an interface");
- Check(new Case(ClassConstraint.Test9), "Generic argument is an array of classes with default ctor");
- Check(new Case(ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
- Check(new Case(ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor");
- Check(new Case(ClassConstraintGenTypes.Test5), "Generic argument is a generic interface");
-
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
-
- Console.WriteLine("POSITIVE TESTS");
- Check(new Case(StructConstraint.Test3), "Generic argument is a struct");
- Check(new Case(StructConstraint.Test8), "Generic argument is an enum");
- Check(new Case(StructConstraint.Test9), "Generic argument is an mscorlib struct");
- Check(new Case(StructConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
-
- Console.WriteLine("POSITIVE TESTS");
- Check(new Case(DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor");
- Check(new Case(DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
-
- Console.WriteLine("POSITIVE TESTS");
- Check(new Case(DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct");
- Check(new Case(DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct");
- Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct");
- Check(new Case(DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum");
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_Constraints_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_Constraints_Pos.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="Instantiation_ClassConstraint_Pos.ilproj" />
- <ProjectReference Include="Instantiation_DefaultCtorAndClassConstraint_Pos.ilproj" />
- <ProjectReference Include="Instantiation_DefaultCtorAndStructConstraint_Pos.ilproj" />
- <ProjectReference Include="Instantiation_DefaultCtorConstraint_Pos.ilproj" />
- <ProjectReference Include="Instantiation_StructConstraint_Pos.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_DefaultCtorAndClassConstraint_Pos {}
-
-
-// Generic class with class() and new() constraints
-.class public auto ansi beforefieldinit D`1<class .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorAndClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorAndClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI_extendC{}
-
-.assembly Instantiation_DefaultCtorAndClassTypeConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit F`1<.ctor ([types_implementI_extendC]C) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Instantiation_DefaultCtorAndClassTypeConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor that implements I and extends C
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
-
-
-
- // POSITIVE TEST
- // generic argument is a generic class with default ctor that implements I and extends C
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a class with default ctor that doesn't implements I but extends C
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor2>::.ctor()
- pop
-
- ret
- }
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorAndClassTypeConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorAndClassTypeConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_DefaultCtorAndStructConstraint_Pos {}
-
-
-// Generic class with struct() and new() constraints
-.class public auto ansi beforefieldinit E`1<valuetype .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [types]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [types]Enum1>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [mscorlib]System.DateTime>::.ctor()
- pop
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [types]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::.ctor()
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorAndStructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorAndStructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_DefaultCtorConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [types]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [mscorlib]System.Object>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [types]Enum1>::.ctor()
- pop
-
- ret
- }
-
-
- // generic argument is NUllable<T>
- .method public hidebysig static void Test10<M>() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<!!M>::.ctor()
- pop
-
- ret
- }
-
-
-}
-
-.class public auto ansi beforefieldinit DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [types]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::.ctor()
- pop
-
- ret
- }
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_DefaultCtorConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_DefaultCtorConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly Instantiation_StructConstraint_Pos {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit C`1<valuetype T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit StructConstraint
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<valuetype [types]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<valuetype [types]Enum1>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<valuetype [mscorlib]System.DateTime>::.ctor()
- pop
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<valuetype [types]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- newobj instance void class C`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::.ctor()
- pop
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Instantiation_StructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Instantiation_StructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI{}
-
-.assembly Interface_DefaultCtorAndClassConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit D`1<class .ctor ([types_implementI]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
-
-
-
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class D`1<class [types_implementI]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
-
-
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorAndClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorAndClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI_extendC{}
-
-.assembly Interface_DefaultCtorAndClassTypeConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit F`1<.ctor ([types_implementI_extendC]C, [types_implementI_extendC]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorAndClassTypeConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor that implements I and extends C
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
-
-
-
- // POSITIVE TEST
- // generic argument is a generic class with default ctor that implements I and extends C
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class F`1<class [types_implementI_extendC]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
-
-
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorAndClassTypeConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorAndClassTypeConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI{}
-
-.assembly Interface_DefaultCtorAndStructConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit E`1<valuetype .ctor ([types_implementI]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
- // NEGATIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [types_implementI]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
-
- // NEGATIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class E`1<valuetype [types_implementI]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-
-
-
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorAndStructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorAndStructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types_implementI{}
-
-.assembly Interface_DefaultCtorConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor ([types_implementI]I) T>
- extends [mscorlib]System.Object
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit Interface_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]ClassWithCtor>::.ctor()
- pop
-
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [types_implementI]NonGenStruct>::.ctor()
- pop
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<class [types_implementI]GenClassWithCtor<int32>>::.ctor()
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- newobj instance void class A`1<valuetype [types_implementI]GenStruct<int32>>::.ctor()
- pop
-
- ret
- }
-
-}
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>Interface_DefaultCtorConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="Interface_DefaultCtorConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-// this file contains positive tests for
-// G<T,U> where T : U where U : struct
-// C# didn't want to compile such type definition so we are using IL.
-
-
-.assembly extern mscorlib {}
-.assembly extern TypeParam_Constraints_Pos {}
-.assembly RunTestPos {}
-
-
-.class public auto ansi beforefieldinit GStruct`2<(!U) T, valuetype U>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-
-.class public auto ansi beforefieldinit RunGStructTest
- extends [mscorlib]System.Object
-{
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
- newobj instance void class GStruct`2<valuetype [TypeParam_Constraints_Pos]S,valuetype [TypeParam_Constraints_Pos]S>::.ctor()
- pop
- ret
- }
-
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
- newobj instance void class GStruct`2<int32,int32>::.ctor()
- pop
- ret
- }
-}
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>RunTestPos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="RunTestPos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="TypeParam_Constraints_Pos.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-// this file contains positive test for
-// GStruct<T> where T : struct
-// G4<P> : GStruct<P> where P : valuetype S
-
-// C# didn't want to compile such type definition so we are using IL.
-
-
-.assembly extern mscorlib {}
-.assembly extern TypeParam2_Constraints_Pos {}
-.assembly RunTestPos2 {}
-
-.class public auto ansi beforefieldinit GStruct`1<valuetype T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit G4`1<(valuetype [TypeParam2_Constraints_Pos]S) P>
- extends class GStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-
-.class public sequential ansi sealed beforefieldinit S_PrivCtor
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-
-
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>RunTestPos2</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="RunTestPos2.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="TypeParam2_Constraints_Pos.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-// this file contains positive test for
-// interface IStruct<T> where T : struct
-// G4<P> : IStruct<P> where P : valuetype S
-
-// C# didn't want to compile such type definition so we are using IL.
-
-
-.assembly extern mscorlib {}
-.assembly extern TypeParam3_Constraints_Pos {}
-.assembly RunTestPos3 {}
-
-.class interface public abstract auto ansi IStruct`1<valuetype T> {}
-
-
-.class public auto ansi beforefieldinit G4`1<(valuetype [TypeParam3_Constraints_Pos]S) P>
- implements class IStruct`1<!P>
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-
-.class public sequential ansi sealed beforefieldinit S_PrivCtor
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-
- .method private hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-
-
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>RunTestPos3</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="RunTestPos3.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="TypeParam3_Constraints_Pos.csproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_ClassConstraint_Pos {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit B`1<class T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_ClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [types]ClassWithCtor>::i
- pop
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [types]ClassNoCtor>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [types]Delegate1>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [mscorlib]System.Object>::i
- pop
-
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- ldsfld int32 class B`1<class [mscorlib]System.ValueType>::i
- pop
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
- ldsfld int32 class B`1<class [types]NonGenInterface>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [types]ClassWithCtor[]>::i
- pop
-
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit SF_ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [types]GenClassWithCtor<int32>>::i
- pop
-
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [types]GenClassNoCtor<int32>>::i
- pop
-
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class B`1<class [types]GenInterface<int32>>::i
- pop
-
- ret
- }
-
-}
-
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_ClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_ClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with legal parameter types accessing static field of the generic type
-
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference tyoe
-default ctor, valuetype
-
-Test each constraint with (whichever apply for positive tests)
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-
-*/
-
-using System;
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
- static void Check(Case mytest, string testName)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
-
- Console.WriteLine(" : PASS");
- return;
- }
- catch (TypeLoadException e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e);
- pass = false;
- return;
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SF_DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(SF_DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)");
- Check(new Case(SF_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor");
- // enum is a valueypte and all valuetypes have public nullary ctors.
- Check(new Case(SF_DefaultCtorConstraint.Test8), "Generic argument is an enum");
- Check(new Case(SF_DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
- Check(new Case(SF_DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(SF_DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable<T>");
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SF_ClassConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(SF_ClassConstraint.Test2), "Generic argument is a class with no default ctor");
- Check(new Case(SF_ClassConstraint.Test4), "Generic argument is a delegate");
- Check(new Case(SF_ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor");
- Check(new Case(SF_ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor");
- Check(new Case(SF_ClassConstraint.Test7), "Generic argument is an interface");
- Check(new Case(SF_ClassConstraint.Test9), "Generic argument is an array of classes with default ctor");
- Check(new Case(SF_ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
- Check(new Case(SF_ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor");
- Check(new Case(SF_ClassConstraintGenTypes.Test5), "Generic argument is a generic interface");
-
-
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SF_StructConstraint.Test3), "Generic argument is a struct");
- Check(new Case(SF_StructConstraint.Test8), "Generic argument is an enum");
- Check(new Case(SF_StructConstraint.Test9), "Generic argument is an mscorlib struct");
- Check(new Case(SF_StructConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(SF_StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(SF_DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor");
- Check(new Case(SF_DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
-
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
- Console.WriteLine("POSITIVE TESTS");
-
-
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct");
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct");
- Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(SF_DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct");
- Check(new Case(SF_DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum");
-
-
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_Constraints_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_Constraints_Pos.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="StaticField_ClassConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticField_DefaultCtorAndClassConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticField_DefaultCtorAndStructConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticField_DefaultCtorConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticField_StructConstraint_Pos.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_DefaultCtorAndClassConstraint_Pos {}
-
-
-// Generic class with class() and new() constraints
-.class public auto ansi beforefieldinit D`1<class .ctor T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]ClassWithCtor>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [mscorlib]System.Object>::i
- pop
-
- ret
- }
-
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class D`1<class [types]GenClassWithCtor<int32>>::i
- pop
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_DefaultCtorAndClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_DefaultCtorAndClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_DefaultCtorAndStructConstraint_Pos {}
-
-
-// Generic class with struct() and new() constraints
-.class public auto ansi beforefieldinit E`1<valuetype .ctor T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<valuetype [types]NonGenStruct>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<valuetype [types]Enum1>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<valuetype [mscorlib]System.DateTime>::i
- pop
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<valuetype [types]GenStruct<int32>>::i
- pop
-
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class E`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::i
- pop
-
- ret
- }
-
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_DefaultCtorAndStructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_DefaultCtorAndStructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_DefaultCtorConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor T>
- extends [mscorlib]System.Object
-{
-
- .field public static int32 i
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]ClassWithCtor>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<valuetype [types]NonGenStruct>::i
- pop
-
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [mscorlib]System.Object>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<valuetype [types]Enum1>::i
- pop
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SF_DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<class [types]GenClassWithCtor<int32>>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<valuetype [types]GenStruct<int32>>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class A`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::i
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_DefaultCtorConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_DefaultCtorConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticField_StructConstraint_Pos {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit C`1<valuetype T>
- extends [mscorlib]System.Object
-{
- .field public static int32 i
-
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SF_StructConstraint
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<valuetype [types]NonGenStruct>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<valuetype [types]Enum1>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<valuetype [mscorlib]System.DateTime>::i
- pop
-
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SF_StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<valuetype [types]GenStruct<int32>>::i
- pop
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- ldsfld int32 class C`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::i
-
- pop
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticField_StructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticField_StructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_ClassConstraint_Pos {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit B`1<class T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_ClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [types]ClassWithCtor>::method1()
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [types]ClassNoCtor>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a delegate
- .method public hidebysig static void Test4() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [types]Delegate1>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [mscorlib]System.Object>::method1()
- ret
- }
-
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib abstract class with no default ctor
-
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
-
- call void class B`1<class [mscorlib]System.ValueType>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an interface
- .method public hidebysig static void Test7() cil managed
- {
- .maxstack 1
- call void class B`1<class [types]NonGenInterface>::method1()
- ret
- }
-
- // POSITIVE TEST
- // generic argument is an array of classes with default ctor
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [types]ClassWithCtor[]>::method1()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit SM_ClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [types]GenClassWithCtor<int32>>::method1()
- ret
- }
-
- // POSITIVE TEST
- // generic argument is a class with no default ctor
- .method public hidebysig static void Test2() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [types]GenClassNoCtor<int32>>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an interface with no default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class B`1<class [types]GenInterface<int32>>::method1()
- ret
- }
-
-}
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_ClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_ClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* Test various combinations of constraints with legal parameter types by invoking static method on the generic type
-CONSTRAINTS:
-
-default ctor
-reference type
-valuetype
-default ctor, reference tyoe
-default ctor, valuetype
-
-Test each constraint with (whichever apply to positive tests)
-- Class with default nullary ctor (Generic/Non generic)
-- Class with no default nullary ctor (Generic/Non generic)
-- Class from mscorlib with default nullary ctor
-- Abstract Class from mscorlib with no default nullary ctor
-
-- Struct from mscorlib (Generic/Non generic)
-- Struct (Generic/Non generic)
-- Enum (Generic/Non generic)
-
-- Interface (Generic/Non generic)
-
-- Array
-
-- Delegate
-
-- Nullable<T>
-*/
-
-using System;
-
-
-public class Test
-{
- static bool pass;
- static int testNumber = 1;
-
- delegate void Case();
-
-
-
- static void Check(Case mytest, string testName)
- {
-
- Console.Write("Test"+testNumber + ": " + testName);
- ++testNumber;
-
-
- try
- {
- mytest();
-
-
- Console.WriteLine(" : PASS");
- return;
- }
- catch (TypeLoadException e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected TypeLoadException: " + e);
- pass = false;
- return;
- }
-
- catch (Exception e)
- {
- Console.WriteLine("\nFAIL: Caught unexpected exception: " + e);
- pass = false;
- }
-
- }
-
-
-
- public static int Main()
- {
- pass = true;
-
- Console.WriteLine("\nType: A<T> where T : new()\n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SM_DefaultCtorConstraint.Test1), "Generic argument is a class with default ctor" );
- Check(new Case(SM_DefaultCtorConstraint.Test3), "Generic argument is a struct (valuetypes have public nullary ctors by default)");
- Check(new Case(SM_DefaultCtorConstraint.Test5), "Generic argument is an mscorlib class with default ctor");
- // enum is a valueypte and all valuetypes have public nullary ctors.
- Check(new Case(SM_DefaultCtorConstraint.Test8), "Generic argument is an enum");
- Check(new Case(SM_DefaultCtorConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
- Check(new Case(SM_DefaultCtorConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(SM_DefaultCtorConstraintGenTypes.Test6), "Generic argument is Nullable<T>");
-
-
- Console.WriteLine("\nType: A<T> where T : class()\n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SM_ClassConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(SM_ClassConstraint.Test2), "Generic argument is a class with no default ctor");
- Check(new Case(SM_ClassConstraint.Test4), "Generic argument is a delegate");
- Check(new Case(SM_ClassConstraint.Test5), "Generic argument is an mscorlib class with default ctor");
- Check(new Case(SM_ClassConstraint.Test6), "Generic argument is an mscorlib abstract class with no default ctor");
- Check(new Case(SM_ClassConstraint.Test7), "Generic argument is an interface");
- Check(new Case(SM_ClassConstraint.Test9), "Generic argument is an array of classes with default ctor");
- Check(new Case(SM_ClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
- Check(new Case(SM_ClassConstraintGenTypes.Test2), "Generic argument is a generic class with no default ctor");
- Check(new Case(SM_ClassConstraintGenTypes.Test5), "Generic argument is a generic interface");
-
-
- Console.WriteLine("\nType: A<T> where T : struct()\n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SM_StructConstraint.Test3), "Generic argument is a struct");
- Check(new Case(SM_StructConstraint.Test8), "Generic argument is an enum");
- Check(new Case(SM_StructConstraint.Test9), "Generic argument is an mscorlib struct");
- Check(new Case(SM_StructConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(SM_StructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct");
-
-
-
- Console.WriteLine("\nType: A<T> where T : class(), new() \n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test1), "Generic argument is a class with default ctor");
- Check(new Case(SM_DefaultCtorAndClassConstraint.Test5), "Generic argument is a is an mscorlib class with default ctor");
- Check(new Case(SM_DefaultCtorAndClassConstraintGenTypes.Test1), "Generic argument is a generic class with default ctor");
-
-
-
- Console.WriteLine("\nType: A<T> where T : struct(), new()\n");
- Console.WriteLine("POSITIVE TESTS");
-
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test3), "Generic argument is a struct");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test9), "Generic argument is an mscorlib struct");
- Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test3), "Generic argument is a generic struct");
- Check(new Case(SM_DefaultCtorAndStructConstraintGenTypes.Test6), "Generic argument is a generic mscorlib struct");
- Check(new Case(SM_DefaultCtorAndStructConstraint.Test8), "Generic argument is an enum");
-
-
- if (pass)
- {
- Console.WriteLine("PASS");
- return 100;
- }
- else
- {
- Console.WriteLine("FAIL");
- return 101;
- }
-
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_Constraints_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>false</ReferenceLocalMscorlib>
- <OutputType>Exe</OutputType>
- <CLRTestKind>BuildAndRun</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_Constraints_Pos.cs" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- <None Include="project.json" />
- </ItemGroup>
-
- <ItemGroup>
- <ProjectReference Include="StaticMethod_ClassConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticMethod_DefaultCtorAndClassConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticMethod_DefaultCtorAndStructConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticMethod_DefaultCtorConstraint_Pos.ilproj" />
- <ProjectReference Include="StaticMethod_StructConstraint_Pos.ilproj" />
- <ProjectReference Include="types.ilproj" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_DefaultCtorAndClassConstraint_Pos {}
-
-
-// Generic class with class() and new() constraints
-.class public auto ansi beforefieldinit D`1<class .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-
-
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]ClassWithCtor>::method1()
- ret
- }
-
-
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [mscorlib]System.Object>::method1()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndClassConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class D`1<class [types]GenClassWithCtor<int32>>::method1()
- ret
- }
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_DefaultCtorAndClassConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_DefaultCtorAndClassConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_DefaultCtorAndStructConstraint_Pos {}
-
-
-// Generic class with struct() and new() constraints
-.class public auto ansi beforefieldinit E`1<valuetype .ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraint
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class E`1<valuetype [types]NonGenStruct>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- call void class E`1<valuetype [types]Enum1>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- call void class E`1<valuetype [mscorlib]System.DateTime>::method1()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorAndStructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class E`1<valuetype [types]GenStruct<int32>>::method1()
- ret
- }
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- call void class E`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::method1()
-
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_DefaultCtorAndStructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_DefaultCtorAndStructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_DefaultCtorConstraint_Pos {}
-
-
-// Generic class with new() constraint
-.class public auto ansi beforefieldinit A`1<.ctor T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorConstraint
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [types]ClassWithCtor>::method1()
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct (valuetypes have public nullary ctors by default)
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class A`1<valuetype [types]NonGenStruct>::method1()
-
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib class with default ctor
- .method public hidebysig static void Test5() cil managed
- {
- .maxstack 1
- call void class A`1<class [mscorlib]System.Object>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum with no default ctor
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- call void class A`1<valuetype [types]Enum1>::method1()
- ret
- }
-
-}
-
-.class public auto ansi beforefieldinit SM_DefaultCtorConstraintGenTypes
- extends [mscorlib]System.Object
-{
- // POSITIVE TEST
- // generic argument is a class with default ctor
- .method public hidebysig static void Test1() cil managed
- {
- .maxstack 1
-
- call void class A`1<class [types]GenClassWithCtor<int32>>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class A`1<valuetype [types]GenStruct<int32>>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is NUllable<T>
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- call void class A`1<valuetype [mscorlib]System.'Nullable`1'<int32>>::method1()
- ret
- }
-
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_DefaultCtorConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_DefaultCtorConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-.assembly extern types{}
-
-.assembly StaticMethod_StructConstraint_Pos {}
-
-
-// Generic class with class() constraint
-.class public auto ansi beforefieldinit C`1<valuetype T>
- extends [mscorlib]System.Object
-{
-
- .method public static hidebysig void
- method1() cil managed
- {
- .maxstack 8
- ret
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_StructConstraint
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class C`1<valuetype [types]NonGenStruct>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an enum
- .method public hidebysig static void Test8() cil managed
- {
- .maxstack 1
-
- call void class C`1<valuetype [types]Enum1>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib struct
- .method public hidebysig static void Test9() cil managed
- {
- .maxstack 1
-
- call void class C`1<valuetype [mscorlib]System.DateTime>::method1()
- ret
- }
-}
-
-.class public auto ansi beforefieldinit SM_StructConstraintGenTypes
- extends [mscorlib]System.Object
-{
-
- // POSITIVE TEST
- // generic argument is a struct
- .method public hidebysig static void Test3() cil managed
- {
- .maxstack 1
-
- call void class C`1<valuetype [types]GenStruct<int32>>::method1()
- ret
- }
-
-
- // POSITIVE TEST
- // generic argument is an mscorlib generic struct
- .method public hidebysig static void Test6() cil managed
- {
- .maxstack 1
-
- call void class C`1<valuetype [mscorlib]System.Collections.Generic.KeyValuePair`2<valuetype [types]NonGenStruct,int32>>::method1()
-
- ret
- }
-}
-
-
-
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>StaticMethod_StructConstraint_Pos</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="StaticMethod_StructConstraint_Pos.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-<?xml version = "1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
+++ /dev/null
-{
- "dependencies": {
- "Microsoft.NETCore.Platforms": "1.0.1-rc2-23816",
- "System.Collections": "4.0.10",
- "System.Collections.NonGeneric": "4.0.1-rc2-23816",
- "System.Collections.Specialized": "4.0.1-rc2-23816",
- "System.ComponentModel": "4.0.1-rc2-23816",
- "System.Console": "4.0.0-rc2-23816",
- "System.Diagnostics.Process": "4.1.0-rc2-23816",
- "System.Globalization": "4.0.10",
- "System.Globalization.Calendars": "4.0.0",
- "System.IO": "4.0.10",
- "System.IO.FileSystem": "4.0.0",
- "System.IO.FileSystem.Primitives": "4.0.0",
- "System.Linq": "4.0.1-rc2-23816",
- "System.Linq.Queryable": "4.0.1-rc2-23816",
- "System.Reflection": "4.0.10",
- "System.Reflection.Primitives": "4.0.0",
- "System.Runtime": "4.1.0-rc2-23816",
- "System.Runtime.Extensions": "4.0.10",
- "System.Runtime.Handles": "4.0.0",
- "System.Runtime.InteropServices": "4.1.0-rc2-23816",
- "System.Runtime.Loader": "4.0.0-rc2-23816",
- "System.Text.Encoding": "4.0.10",
- "System.Threading": "4.0.10",
- "System.Threading.Thread": "4.0.0-rc2-23816",
- "System.Xml.ReaderWriter": "4.0.11-rc2-23816",
- "System.Xml.XDocument": "4.0.11-rc2-23816",
- "System.Xml.XmlDocument": "4.0.1-rc2-23816",
- "System.Xml.XmlSerializer": "4.0.11-rc2-23816"
- },
- "frameworks": {
- "dnxcore50": {}
- }
-}
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly Types {}
-
-// class with public nullary ctor
-.class public auto ansi beforefieldinit ClassWithCtor
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends [mscorlib]System.Object
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends [mscorlib]System.Object
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends [mscorlib]System.Object
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly Types_implementI {}
-
-
-.class interface public abstract auto ansi I {}
-
-
-// class with public nullary ctor
-.class public auto ansi beforefieldinit ClassWithCtor
- extends [mscorlib]System.Object
- implements I
-
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends [mscorlib]System.Object
- implements I
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends [mscorlib]System.Object
- implements I
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends [mscorlib]System.Object
- implements I
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
- implements I
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
- implements I
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
- implements I
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types_implementI</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types_implementI.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-.assembly extern System.Console { }
-
-.assembly extern mscorlib{}
-
-.assembly types_implementI_extendC {}
-
-
-.class interface public abstract auto ansi I {}
-
-.class public auto ansi beforefieldinit C
- extends [mscorlib]System.Object
- implements I
-
-{}
-
-// class with public nullary ctor
-.class public auto ansi beforefieldinit ClassWithCtor
- extends C
- implements I
-
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// class with public nullary ctor extends C but doesn't implement I
-.class public auto ansi beforefieldinit ClassWithCtor2
- extends C
-
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-// generic class with public nullary ctor
-.class public auto ansi beforefieldinit GenClassWithCtor<T>
- extends C
- implements I
-{
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 8
- ldarg.0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-}
-
-
-// class without public nullary ctor
-.class public auto ansi beforefieldinit ClassNoCtor
- extends C
- implements I
-{
-}
-
-// generic class without public nullary ctor
-.class public auto ansi beforefieldinit GenClassNoCtor<T>
- extends C
- implements I
-{
-}
-
-
-// struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit NonGenStruct
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-
-
-// generic struct (valuetypes have public nullary ctors by default)
-.class public sequential ansi sealed beforefieldinit GenStruct<T>
- extends [mscorlib]System.ValueType
- implements I
-{
- .pack 0
- .size 1
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit NonGenInterface
- implements I
-{
-}
-
-// interface without public nullary ctor
-.class public abstract interface auto ansi beforefieldinit GenInterface<T>
- implements I
-{
-}
-
-
-.class public auto ansi sealed Enum1
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
- .field public static literal valuetype Enum1 One = int32(0x00000000)
-}
-
-
-// doesn't have public parameterless constructor
-.class public auto ansi sealed Delegate1
- extends [mscorlib]System.MulticastDelegate
- implements I
-{
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor(object 'object',
- native int 'method') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void Invoke() runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance class [mscorlib]System.IAsyncResult
- BeginInvoke(class [mscorlib]System.AsyncCallback callback,
- object 'object') runtime managed
- {
- }
-
- .method public hidebysig newslot virtual
- instance void EndInvoke(class [mscorlib]System.IAsyncResult result) runtime managed
- {
- }
-}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <AssemblyName>types_implementI_extendC</AssemblyName>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- <ReferenceLocalMscorlib>true</ReferenceLocalMscorlib>
- <OutputType>Library</OutputType>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <CLRTestPriority>0</CLRTestPriority>
- </PropertyGroup>
-
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
-
- <ItemGroup>
- <Compile Include="types_implementI_extendC.il" />
- </ItemGroup>
-
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
-
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>