stage2 astgen: Use rl semantics for @Type

Resolves #12430.
This commit is contained in:
Cody Tapscott 2022-08-12 14:47:54 -07:00 committed by Veikka Tuominen
parent bfe8a4d9f6
commit 7e07f3d4f9
3 changed files with 14 additions and 1 deletions

View File

@ -7676,7 +7676,8 @@ fn builtinCall(
} },
});
gz.instructions.appendAssumeCapacity(new_index);
return indexToRef(new_index);
const result = indexToRef(new_index);
return rvalue(gz, rl, result, node);
},
.panic => {
try emitDbgNode(gz, node);

View File

@ -84,6 +84,7 @@ test {
_ = @import("behavior/bugs/11213.zig");
_ = @import("behavior/bugs/12003.zig");
_ = @import("behavior/bugs/12033.zig");
_ = @import("behavior/bugs/12430.zig");
_ = @import("behavior/byteswap.zig");
_ = @import("behavior/byval_arg_var.zig");
_ = @import("behavior/call.zig");

View File

@ -0,0 +1,11 @@
const std = @import("std");
test {
const T = comptime b: {
break :b @Type(.{ .Int = .{
.signedness = .unsigned,
.bits = 8,
} });
};
try std.testing.expect(T == u8);
}