提交 571ea520 编写于 作者: T Ty Overby

Merge pull request #5796 from TyOverby/91-async-error-msg

Change error CS1994 message
......@@ -899,7 +899,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to The &apos;async&apos; modifier can only be used in methods that have a statement body..
/// Looks up a localized string similar to The &apos;async&apos; modifier can only be used in methods that have a body..
/// </summary>
internal static string ERR_BadAsyncLacksBody {
get {
......
......@@ -3537,7 +3537,7 @@ Give the compiler some way to differentiate the methods. For example, you can gi
<value>Cannot await in an unsafe context</value>
</data>
<data name="ERR_BadAsyncLacksBody" xml:space="preserve">
<value>The 'async' modifier can only be used in methods that have a statement body.</value>
<value>The 'async' modifier can only be used in methods that have a body.</value>
</data>
<data name="ERR_BadSpecialByRefLocal" xml:space="preserve">
<value>Parameters or locals of type '{0}' cannot be declared in async methods or lambda expressions.</value>
......
......@@ -3168,7 +3168,7 @@ static class Test
static async Task M1();
}";
CreateCompilationWithMscorlib45(source).VerifyDiagnostics(
// (6,23): error CS1994: The 'async' modifier can only be used in methods that have a statement body
// (6,23): error CS1994: The 'async' modifier can only be used in methods that have a body
// static async Task M1();
Diagnostic(ErrorCode.ERR_BadAsyncLacksBody, "M1"));
}
......@@ -3184,7 +3184,7 @@ static class Test
static async Task M1(__arglist);
}";
CreateCompilationWithMscorlib45(source).VerifyDiagnostics(
// (6,23): error CS1994: The 'async' modifier can only be used in methods that have a statement body
// (6,23): error CS1994: The 'async' modifier can only be used in methods that have a body
// static async Task M1(__arglist);
Diagnostic(ErrorCode.ERR_BadAsyncLacksBody, "M1"));
}
......@@ -3476,7 +3476,7 @@ public static int Main()
}
}";
CreateCompilationWithMscorlib45(source).VerifyDiagnostics(
// (4,32): error CS1994: The 'async' modifier can only be used in methods that have a statement body.
// (4,32): error CS1994: The 'async' modifier can only be used in methods that have a body.
// public async abstract void M1();
Diagnostic(ErrorCode.ERR_BadAsyncLacksBody, "M1"));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册