aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-13 16:34:33 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-13 16:34:33 -0400
commitc06a61e9bf93810174255474598cfeae785cfbd6 (patch)
tree27d8f4262d8cd8c72c75e348e63e6c7d6a6ec0d4 /test/compile_errors.zig
parent7c3636aaa38e8efa77b73ba94362802517ea739e (diff)
downloadzig-c06a61e9bf93810174255474598cfeae785cfbd6.tar.gz
zig-c06a61e9bf93810174255474598cfeae785cfbd6.zip
remove `this`. add `@This()`.
closes #1283
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig28
1 files changed, 13 insertions, 15 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 750794c909..6bdbca9ff5 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -3813,11 +3813,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\ return struct {
\\ b: B(),
\\
- \\ const Self = this;
+ \\ const Self = @This();
\\
\\ fn B() type {
\\ return struct {
- \\ const Self = this;
+ \\ const Self = @This();
\\ };
\\ }
\\ };
@@ -4314,12 +4314,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
\\ var a = undefined;
\\ var b = 1;
\\ var c = 1.0;
- \\ var d = this;
- \\ var e = null;
- \\ var f = opaque.*;
- \\ var g = i32;
- \\ var h = @import("std",);
- \\ var i = (Foo {}).bar;
+ \\ var d = null;
+ \\ var e = opaque.*;
+ \\ var f = i32;
+ \\ var g = @import("std",);
+ \\ var h = (Foo {}).bar;
\\
\\ var z: noreturn = return;
\\}
@@ -4332,13 +4331,12 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
".tmp_source.zig:7:4: error: variable of type '(undefined)' must be const or comptime",
".tmp_source.zig:8:4: error: variable of type 'comptime_int' must be const or comptime",
".tmp_source.zig:9:4: error: variable of type 'comptime_float' must be const or comptime",
- ".tmp_source.zig:10:4: error: variable of type '(block)' must be const or comptime",
- ".tmp_source.zig:11:4: error: variable of type '(null)' must be const or comptime",
- ".tmp_source.zig:12:4: error: variable of type 'Opaque' not allowed",
- ".tmp_source.zig:13:4: error: variable of type 'type' must be const or comptime",
- ".tmp_source.zig:14:4: error: variable of type '(namespace)' must be const or comptime",
- ".tmp_source.zig:15:4: error: variable of type '(bound fn(*const Foo) void)' must be const or comptime",
- ".tmp_source.zig:17:4: error: unreachable code",
+ ".tmp_source.zig:10:4: error: variable of type '(null)' must be const or comptime",
+ ".tmp_source.zig:11:4: error: variable of type 'Opaque' not allowed",
+ ".tmp_source.zig:12:4: error: variable of type 'type' must be const or comptime",
+ ".tmp_source.zig:13:4: error: variable of type '(namespace)' must be const or comptime",
+ ".tmp_source.zig:14:4: error: variable of type '(bound fn(*const Foo) void)' must be const or comptime",
+ ".tmp_source.zig:16:4: error: unreachable code",
);
cases.add(