[mcs] Initial by ref returns and variables support
[mono.git] / mcs / mcs / generic.cs
index 6b35de9846c6ba3d0be116b321af98c721297926..625cd0c773f0588fefcd0b3055c1ddbc20d0e44a 100644 (file)
@@ -1543,6 +1543,9 @@ namespace Mono.CSharp {
                                        if (ec is PointerContainer)
                                                return PointerContainer.MakeType (context.Module, et);
 
+                                       if (ec is ReferenceContainer)
+                                               return ReferenceContainer.MakeType (context.Module, et);
+                                       
                                        throw new NotImplementedException ();
                                }
 
@@ -1772,7 +1775,10 @@ namespace Mono.CSharp {
                        foreach (var arg in targs) {
                                if (arg.HasDynamicElement || arg.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
                                        state |= StateFlags.HasDynamicElement;
-                                       break;
+                               }
+
+                               if (arg.HasNamedTupleElement) {
+                                       state |= StateFlags.HasNamedTupleElement;
                                }
                        }
 
@@ -1852,6 +1858,12 @@ namespace Mono.CSharp {
                        }
                }
 
+               public override bool IsTupleType {
+                       get {
+                               return (open_type.state & StateFlags.Tuple) != 0;
+                       }
+               }
+
                //
                // Types used to inflate the generic  type
                //
@@ -3095,6 +3107,9 @@ namespace Mono.CSharp {
                            bound.Type == InternalType.ThrowExpr)
                                return;
 
+                       if (bound.Type.IsTupleType && TupleLiteral.ContainsNoTypeElement (bound.Type))
+                               return;
+
                        var a = bounds [index];
                        if (a == null) {
                                a = new List<BoundInfo> (2);