Merge pull request #2630 from ludovic-henry/fix-registeredwaithandle-leak
[mono.git] / mcs / mcs / typemanager.cs
index 6e785dfc097e7e8b082cbd15a0c79cbaab201adb..a5a9ad15607da053892c5073fee28ecfcdd25130 100644 (file)
@@ -233,6 +233,11 @@ namespace Mono.CSharp
                public readonly PredefinedType INotifyCompletion;
                public readonly PredefinedType ICriticalNotifyCompletion;
 
+               // C# 6.0
+               public readonly PredefinedType IFormattable;
+               public readonly PredefinedType FormattableString;
+               public readonly PredefinedType FormattableStringFactory;
+
                public PredefinedTypes (ModuleContainer module)
                {
                        TypedReference = new PredefinedType (module, MemberKind.Struct, "System", "TypedReference");
@@ -286,6 +291,10 @@ namespace Mono.CSharp
                        INotifyCompletion = new PredefinedType (module, MemberKind.Interface, "System.Runtime.CompilerServices", "INotifyCompletion");
                        ICriticalNotifyCompletion = new PredefinedType (module, MemberKind.Interface, "System.Runtime.CompilerServices", "ICriticalNotifyCompletion");
 
+                       IFormattable = new PredefinedType (module, MemberKind.Interface, "System", "IFormattable");
+                       FormattableString = new PredefinedType (module, MemberKind.Class, "System", "FormattableString");
+                       FormattableStringFactory = new PredefinedType (module, MemberKind.Class, "System.Runtime.CompilerServices", "FormattableStringFactory");
+
                        //
                        // Define types which are used for comparison. It does not matter
                        // if they don't exist as no error report is needed
@@ -322,6 +331,9 @@ namespace Mono.CSharp
                                TaskGeneric.TypeSpec.IsGenericTask = true;
 
                        SwitchUserTypes = Switch.CreateSwitchUserTypes (module, Nullable.TypeSpec);
+
+                       IFormattable.Define ();
+                       FormattableString.Define ();
                }
        }
 
@@ -372,6 +384,7 @@ namespace Mono.CSharp
                public readonly PredefinedMember<MethodSpec> FixedBufferAttributeCtor;
                public readonly PredefinedMember<MethodSpec> MethodInfoGetMethodFromHandle;
                public readonly PredefinedMember<MethodSpec> MethodInfoGetMethodFromHandle2;
+               public readonly PredefinedMember<MethodSpec> MethodInfoCreateDelegate;
                public readonly PredefinedMember<MethodSpec> MonitorEnter;
                public readonly PredefinedMember<MethodSpec> MonitorEnter_v4;
                public readonly PredefinedMember<MethodSpec> MonitorExit;
@@ -647,6 +660,10 @@ namespace Mono.CSharp
                        MethodInfoGetMethodFromHandle2 = new PredefinedMember<MethodSpec> (module, types.MethodBase,
                                "GetMethodFromHandle", MemberKind.Method, types.RuntimeMethodHandle, new PredefinedType (btypes.RuntimeTypeHandle));
 
+                       MethodInfoCreateDelegate = new PredefinedMember<MethodSpec> (module, types.MethodInfo,
+                                                                                    "CreateDelegate", MemberKind.Method,
+                                                                                    new PredefinedType (btypes.Type), new PredefinedType (btypes.Object));
+
                        MonitorEnter = new PredefinedMember<MethodSpec> (module, types.Monitor, "Enter", btypes.Object);
 
                        MonitorEnter_v4 = new PredefinedMember<MethodSpec> (module, types.Monitor,