--- /dev/null
+// CS0815: An implicitly typed local variable declaration cannot be initialized with `anonymous method'
+// Line: 11
+
+using System;
+using System.Threading.Tasks;
+
+class X
+{
+ public static void Main ()
+ {
+ Task.Run(async () => { var a = async () => { }; Console.WriteLine(a); });
+ }
+}
\ No newline at end of file
if (compatibles.TryGetValue (type, out am))
return am;
+ if (type == InternalType.ErrorType)
+ return null;
+
TypeSpec delegate_type = CompatibleChecks (ec, type);
if (delegate_type == null)
return null;
ec.Report.Error (815, loc,
"An implicitly typed local variable declaration cannot be initialized with `{0}'",
type.GetSignatureForError ());
+ type = InternalType.ErrorType;
return false;
}