var delegate_method = method.Spec;
if (storey != null && storey.MemberName.IsGeneric) {
- TypeSpec t = storey.Instance.Type;
-
//
// Mutate anonymous method instance type if we are in nested
// hoisted generic anonymous method storey
//
if (ec.IsAnonymousStoreyMutateRequired) {
- t = storey.Mutator.Mutate (t);
+ ec.Emit (OpCodes.Ldftn, delegate_method);
+ } else {
+ TypeSpec t = storey.Instance.Type;
+ ec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ()));
}
-
- ec.Emit (OpCodes.Ldftn, TypeBuilder.GetMethod (t.GetMetaInfo (), (MethodInfo) delegate_method.GetMetaInfo ()));
} else {
if (delegate_method.IsGeneric) {
TypeParameterSpec[] tparams;
--- /dev/null
+using System;
+using System.Linq;
+using System.Collections.Generic;
+
+class X
+{
+ public static void Execute<TArg>(TArg args)
+ {
+ Action a = () => {
+ List<string> s = new List<string> () {
+ "test"
+ };
+
+ object res = null;
+ var res2 = s.Select(acrl => acrl.Select(acr => res)).ToArray ();
+ };
+
+ a ();
+ }
+
+ public static void Main ()
+ {
+ Execute<string> (null);
+ }
+}
\ No newline at end of file
</method>
</type>
</test>
+ <test name="test-anon-177.cs">
+ <type name="X">
+ <method name="Void Execute[TArg](TArg)" attrs="150">
+ <size>21</size>
+ </method>
+ <method name="Void Main()" attrs="150">
+ <size>8</size>
+ </method>
+ <method name="Void <Execute`1>m__0[TArg]()" attrs="145">
+ <size>58</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="X+<Execute>c__AnonStorey0`1[TArg]">
+ <method name="System.Collections.Generic.IEnumerable`1[System.Object] <>m__0(System.String)" attrs="131">
+ <size>26</size>
+ </method>
+ <method name="System.Object <>m__1(Char)" attrs="131">
+ <size>14</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-anon-18.cs">
<type name="A">
<method name="Void Invoke()" attrs="454">