Sema: implement tupleFieldVal, fix comptime elem_ptr

This commit is contained in:
Andrew Kelley
2022-02-24 22:27:54 -07:00
parent adb746a701
commit 27eb42c15e
9 changed files with 90 additions and 33 deletions

View File

@@ -691,8 +691,6 @@ test "string escapes" {
}
test "explicit cast optional pointers" {
if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
const a: ?*i32 = undefined;
const b: ?*f32 = @ptrCast(?*f32, a);
_ = b;
@@ -735,7 +733,6 @@ test "string concatenation" {
}
test "thread local variable" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
const S = struct {
@@ -746,7 +743,11 @@ test "thread local variable" {
}
test "result location is optional inside error union" {
if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
const x = maybe(true) catch unreachable;
try expect(x.? == 42);
@@ -760,7 +761,6 @@ fn maybe(x: bool) anyerror!?u32 {
}
test "pointer to thread local array" {
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
const s = "Hello world";