[mdoc] Add tests for C#4 variance support.
authorJonathan Pryor <jonpryor@vt.edu>
Mon, 3 Oct 2011 19:27:56 +0000 (15:27 -0400)
committerJonathan Pryor <jonpryor@vt.edu>
Mon, 3 Oct 2011 19:55:13 +0000 (15:55 -0400)
mcs/tools/mdoc/Test/DocTest-v1.cs
mcs/tools/mdoc/Test/en.expected.delete/Mono.DocTest.Generic/Func`2.xml
mcs/tools/mdoc/Test/en.expected.importslashdoc/Mono.DocTest.Generic/Func`2.xml
mcs/tools/mdoc/Test/en.expected.since/Mono.DocTest.Generic/Func`2.xml
mcs/tools/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml
mcs/tools/mdoc/Test/html.expected/Mono.DocTest.Generic/Func`2.html

index 259de7078d1d30bc5b460097cc3255c9940e05e9..de273abf167f70818b022eefc50178b5297fcf94 100644 (file)
@@ -449,7 +449,7 @@ namespace Mono.DocTest.Generic {
        /// <remarks><c>T:Mono.DocTest.Generic.Func`2</c>.</remarks>
        [Doc ("method")]
        [return:Doc ("return", Field=false)]
-       public delegate TRet Func<[Doc ("arg!")] TArg, [Doc ("ret!")] TRet> (
+       public delegate TRet Func<[Doc ("arg!")] in TArg, [Doc ("ret!")] out TRet> (
                        [Doc ("arg-actual")] TArg a
        ) where TArg : Exception;
 }
index 403666c6891f7ee108b24e9a322286aa9b90df38..a50eb6566937f49850a2ad3a16b846862fff75ad 100644 (file)
@@ -1,6 +1,6 @@
 <Type Name="Func&lt;TArg,TRet&gt;" FullName="Mono.DocTest.Generic.Func&lt;TArg,TRet&gt;">
-  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;TArg,TRet&gt;(TArg a) where TArg : Exception;" />
-  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) TArg, TRet&gt; extends System.MulticastDelegate" />
+  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;in TArg,out TRet&gt;(TArg a) where TArg : Exception;" />
+  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) - TArg, + TRet&gt; extends System.MulticastDelegate" />
   <AssemblyInfo>
     <AssemblyName>DocTest</AssemblyName>
   </AssemblyInfo>
@@ -12,6 +12,7 @@
         </Attribute>
       </Attributes>
       <Constraints>
+        <ParameterAttribute>Contravariant</ParameterAttribute>
         <BaseTypeName>System.Exception</BaseTypeName>
       </Constraints>
     </TypeParameter>
@@ -21,6 +22,9 @@
           <AttributeName>Mono.DocTest.Doc("ret!")</AttributeName>
         </Attribute>
       </Attributes>
+      <Constraints>
+        <ParameterAttribute>Covariant</ParameterAttribute>
+      </Constraints>
     </TypeParameter>
   </TypeParameters>
   <Base>
index 5c8ad7435699a41a9b84bb42c63ddfb4d0165e03..9e1695e23ce7142a14b3d17e2f135df24e0ecbab 100644 (file)
@@ -1,6 +1,6 @@
 <Type Name="Func&lt;TArg,TRet&gt;" FullName="Mono.DocTest.Generic.Func&lt;TArg,TRet&gt;">
-  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;TArg,TRet&gt;(TArg a) where TArg : Exception;" />
-  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) TArg, TRet&gt; extends System.MulticastDelegate" />
+  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;in TArg,out TRet&gt;(TArg a) where TArg : Exception;" />
+  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) - TArg, + TRet&gt; extends System.MulticastDelegate" />
   <AssemblyInfo>
     <AssemblyName>DocTest</AssemblyName>
     <AssemblyVersion>0.0.0.0</AssemblyVersion>
@@ -13,6 +13,7 @@
         </Attribute>
       </Attributes>
       <Constraints>
+        <ParameterAttribute>Contravariant</ParameterAttribute>
         <BaseTypeName>System.Exception</BaseTypeName>
       </Constraints>
     </TypeParameter>
@@ -22,6 +23,9 @@
           <AttributeName>Mono.DocTest.Doc("ret!")</AttributeName>
         </Attribute>
       </Attributes>
+      <Constraints>
+        <ParameterAttribute>Covariant</ParameterAttribute>
+      </Constraints>
     </TypeParameter>
   </TypeParameters>
   <Base>
index a272ffae4e118e34ae5ecee4c42dc610ce87c4c8..48a99ddbbaf433aec7916857e87b08902a3a16e7 100644 (file)
@@ -1,6 +1,6 @@
 <Type Name="Func&lt;TArg,TRet&gt;" FullName="Mono.DocTest.Generic.Func&lt;TArg,TRet&gt;">
-  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;TArg,TRet&gt;(TArg a) where TArg : Exception;" />
-  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) TArg, TRet&gt; extends System.MulticastDelegate" />
+  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;in TArg,out TRet&gt;(TArg a) where TArg : Exception;" />
+  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) - TArg, + TRet&gt; extends System.MulticastDelegate" />
   <AssemblyInfo>
     <AssemblyName>DocTest</AssemblyName>
     <AssemblyVersion>0.0.0.0</AssemblyVersion>
@@ -14,6 +14,7 @@
         </Attribute>
       </Attributes>
       <Constraints>
+        <ParameterAttribute>Contravariant</ParameterAttribute>
         <BaseTypeName>System.Exception</BaseTypeName>
       </Constraints>
     </TypeParameter>
@@ -23,6 +24,9 @@
           <AttributeName>Mono.DocTest.Doc("ret!")</AttributeName>
         </Attribute>
       </Attributes>
+      <Constraints>
+        <ParameterAttribute>Covariant</ParameterAttribute>
+      </Constraints>
     </TypeParameter>
   </TypeParameters>
   <Base>
index a52f177d1822521bc0249b54cd3c4ebdea8c0abf..2d8dcf09ea2c5547cb0cc43c8426e35c5238acdc 100644 (file)
@@ -1,6 +1,6 @@
 <Type Name="Func&lt;TArg,TRet&gt;" FullName="Mono.DocTest.Generic.Func&lt;TArg,TRet&gt;">
-  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;TArg,TRet&gt;(TArg a) where TArg : Exception;" />
-  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) TArg, TRet&gt; extends System.MulticastDelegate" />
+  <TypeSignature Language="C#" Value="public delegate TRet Func&lt;in TArg,out TRet&gt;(TArg a) where TArg : Exception;" />
+  <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed Func`2&lt;(class System.Exception) - TArg, + TRet&gt; extends System.MulticastDelegate" />
   <AssemblyInfo>
     <AssemblyName>DocTest</AssemblyName>
     <AssemblyVersion>0.0.0.0</AssemblyVersion>
@@ -13,6 +13,7 @@
         </Attribute>
       </Attributes>
       <Constraints>
+        <ParameterAttribute>Contravariant</ParameterAttribute>
         <BaseTypeName>System.Exception</BaseTypeName>
       </Constraints>
     </TypeParameter>
@@ -22,6 +23,9 @@
           <AttributeName>Mono.DocTest.Doc("ret!")</AttributeName>
         </Attribute>
       </Attributes>
+      <Constraints>
+        <ParameterAttribute>Covariant</ParameterAttribute>
+      </Constraints>
     </TypeParameter>
   </TypeParameters>
   <Base>
index b2fc424000fa57576f04087399e841571781bce1..78e190fc140f193e61d8b623423d0101fc222209 100644 (file)
     </p>
     <div id="T:Mono.DocTest.Generic.Func`2:Signature">
       <h2>Syntax</h2>
-      <div class="Signature">[Mono.DocTest.Doc("method")]<br />[return:Mono.DocTest.Doc("return", Field=false)]<br />public delegate <i title="return type, with attributes!">TRet</i> <b>Func&lt;[Mono.DocTest.Doc("arg!")] TArg, [Mono.DocTest.Doc("ret!")] TRet&gt;</b> ([Mono.DocTest.Doc("arg-actual")] <i title="argument type, with attributes!">TArg</i> a)<br /> where TArg : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Exception">Exception</a></div>
+      <div class="Signature">[Mono.DocTest.Doc("method")]<br />[return:Mono.DocTest.Doc("return", Field=false)]<br />public delegate <i title="return type, with attributes!">TRet</i> <b>Func&lt;[Mono.DocTest.Doc("arg!")] TArg, [Mono.DocTest.Doc("ret!")] TRet&gt;</b> ([Mono.DocTest.Doc("arg-actual")] <i title="argument type, with attributes!">TArg</i> a)<br /> where TArg : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Exception">Exception</a><br /> where TRet : </div>
     </div>
     <div class="Remarks" id="T:Mono.DocTest.Generic.Func`2:Docs">
       <h4 class="Subsection">Type Parameters</h4>