0
Visual Studio 11プレビューのバグ?Visual Studio 11 CTP3のバグ?
次の例をコンパイルして、予期しないコンパイルエラーが発生しました。
例1:
async = System.Threading.Tasks.Task;
partial = System.Threading.Tasks.Task;
class C
{
async async async(async async) { } // ok
async partial async(async async) { } // error CS1002: ; expected
}
例2:
var a = new Action((() => {}));
以来
using System.Threading.Tasks;
class C
{
delegate Task<dynamic> ady(dynamic i);
delegate Task adv();
void f()
{
ady d11 = new ady(async j => await j); // ok
ady d12 = new ady((async j => await j)); // error CS0149: Method name expected
ady d21 = new ady(async (j) => await j); // ok
ady d22 = new ady((async (j) => await j)); // error CS0149: Method name expected
adv d31 = new adv(async() => { dynamic d = 0; await d; }); // ok
adv d32 = new adv((async() => { dynamic d = 0; await d; })); // error CS0149: Method name expected
adv d41 = new adv(async delegate { }); // ok
adv d42 = new adv((async delegate { })); // error CS0149: Method name expected
adv d61 = new adv(async delegate { }); // ok
adv d62 = new adv((async delegate { })); // error CS0149: Method name expected
ady d71 = new ady(async delegate(dynamic d) { return await d; }); // ok
ady d72 = new ady((async delegate(dynamic d) { return await d; })); // error CS0149: Method name expected
}
}
レポートCTP(リリースされるとベータ版)はhttp://connect.microsoft.comで発行されます。 – Richard