replace %return with try

See #632

better fits the convention of using keywords for control flow
This commit is contained in:
Andrew Kelley
2018-01-07 16:51:46 -05:00
parent de1f57926f
commit 66717db735
41 changed files with 810 additions and 801 deletions

View File

@@ -1051,9 +1051,9 @@ pub fn addCases(cases: &tests.CompileErrorContext) {
\\export fn entry() -> usize { return @sizeOf(@typeOf(f)); }
, ".tmp_source.zig:3:26: error: expected signed integer type, found 'u32'");
cases.add("%return in function with non error return type",
cases.add("try in function with non error return type",
\\export fn f() {
\\ %return something();
\\ try something();
\\}
\\fn something() -> %void { }
,
@@ -1290,7 +1290,7 @@ pub fn addCases(cases: &tests.CompileErrorContext) {
\\pub fn testTrickyDefer() -> %void {
\\ defer canFail() %% {};
\\
\\ defer %return canFail();
\\ defer try canFail();
\\
\\ const a = maybeInt() ?? return;
\\}