public static MethodSpec CreateMethod (MethodBase mb, TypeSpec declaringType)
{
Modifiers mod = ReadMethodModifiers (mb, declaringType);
- //if (declaringType.IsInterface) {
- // mod = (mod & ~Modifiers.ABSTRACT) | Modifiers.VIRTUAL;
- //}
-
TypeParameterSpec[] tparams;
ImportedMethodDefinition definition;
import_cache.Add (type, spec);
var constraints = type.GetGenericParameterConstraints ();
+ List<TypeSpec> tparams = null;
foreach (var ct in constraints) {
- // TODO MemberCache: What to do ??
if (ct.IsGenericParameter) {
+ if (tparams == null)
+ tparams = new List<TypeSpec> ();
+
+ tparams.Add (CreateType (ct));
continue;
}
if (spec.BaseType == null)
spec.BaseType = TypeManager.object_type;
+ if (tparams != null)
+ spec.TypeArguments = tparams.ToArray ();
+
return spec;
}
--- /dev/null
+// Compiler options: -t:library
+
+public interface IServicesContainer
+{
+ void Register<I, T> () where T : I;
+ void Register<I> (object instance);
+}
--- /dev/null
+// Compiler options: -r:gtest-532-lib.dll
+
+using System;
+
+public class DictionaryServicesContainer : IServicesContainer
+{
+ public void Register<I, T> () where T : I
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Register<I> (object instance)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public I Resolve<I> ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static void Main ()
+ {
+ new DictionaryServicesContainer ();
+ }
+}