std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
This commit is contained in:
@@ -401,15 +401,15 @@ fn callFn(comptime f: anytype, args: anytype) switch (Impl) {
|
||||
const default_value = if (Impl == PosixThreadImpl) null else 0;
|
||||
const bad_fn_ret = "expected return type of startFn to be 'u8', 'noreturn', '!noreturn', 'void', or '!void'";
|
||||
|
||||
switch (@typeInfo(@typeInfo(@TypeOf(f)).Fn.return_type.?)) {
|
||||
.NoReturn => {
|
||||
switch (@typeInfo(@typeInfo(@TypeOf(f)).@"fn".return_type.?)) {
|
||||
.noreturn => {
|
||||
@call(.auto, f, args);
|
||||
},
|
||||
.Void => {
|
||||
.void => {
|
||||
@call(.auto, f, args);
|
||||
return default_value;
|
||||
},
|
||||
.Int => |info| {
|
||||
.int => |info| {
|
||||
if (info.bits != 8) {
|
||||
@compileError(bad_fn_ret);
|
||||
}
|
||||
@@ -422,7 +422,7 @@ fn callFn(comptime f: anytype, args: anytype) switch (Impl) {
|
||||
// pthreads don't support exit status, ignore value
|
||||
return default_value;
|
||||
},
|
||||
.ErrorUnion => |info| {
|
||||
.error_union => |info| {
|
||||
switch (info.payload) {
|
||||
void, noreturn => {
|
||||
@call(.auto, f, args) catch |err| {
|
||||
@@ -850,17 +850,17 @@ const WasiThreadImpl = struct {
|
||||
fn entry(ptr: usize) void {
|
||||
const w: *@This() = @ptrFromInt(ptr);
|
||||
const bad_fn_ret = "expected return type of startFn to be 'u8', 'noreturn', 'void', or '!void'";
|
||||
switch (@typeInfo(@typeInfo(@TypeOf(f)).Fn.return_type.?)) {
|
||||
.NoReturn, .Void => {
|
||||
switch (@typeInfo(@typeInfo(@TypeOf(f)).@"fn".return_type.?)) {
|
||||
.noreturn, .void => {
|
||||
@call(.auto, f, w.args);
|
||||
},
|
||||
.Int => |info| {
|
||||
.int => |info| {
|
||||
if (info.bits != 8) {
|
||||
@compileError(bad_fn_ret);
|
||||
}
|
||||
_ = @call(.auto, f, w.args); // WASI threads don't support exit status, ignore value
|
||||
},
|
||||
.ErrorUnion => |info| {
|
||||
.error_union => |info| {
|
||||
if (info.payload != void) {
|
||||
@compileError(bad_fn_ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user