mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
Additional replacements of @typeOf with @TypeOf
This commit is contained in:
parent
4b4fbe3887
commit
8c096707b7
@ -80,7 +80,7 @@ fn peekIsAlign(comptime fmt: []const u8) bool {
|
||||
///
|
||||
/// If a formatted user type contains a function of the type
|
||||
/// ```
|
||||
/// fn format(value: ?, comptime fmt: []const u8, options: std.fmt.FormatOptions, context: var, comptime Errors: type, output: fn (@typeOf(context), []const u8) Errors!void) Errors!void
|
||||
/// fn format(value: ?, comptime fmt: []const u8, options: std.fmt.FormatOptions, context: var, comptime Errors: type, output: fn (@TypeOf(context), []const u8) Errors!void) Errors!void
|
||||
/// ```
|
||||
/// with `?` being the type formatted, this function will be called instead of the default implementation.
|
||||
/// This allows user types to be formatted in a logical manner instead of dumping all fields of the type.
|
||||
|
||||
@ -138,7 +138,7 @@ pub const Thread = struct {
|
||||
};
|
||||
|
||||
/// caller must call wait on the returned thread
|
||||
/// fn startFn(@typeOf(context)) T
|
||||
/// fn startFn(@TypeOf(context)) T
|
||||
/// where T is u8, noreturn, void, or !void
|
||||
/// caller must call wait on the returned thread
|
||||
pub fn spawn(context: var, comptime startFn: var) SpawnError!*Thread {
|
||||
|
||||
@ -1071,7 +1071,7 @@ test "zig fmt: line comment after doc comment" {
|
||||
test "zig fmt: float literal with exponent" {
|
||||
try testCanonical(
|
||||
\\test "bit field alignment" {
|
||||
\\ assert(@typeOf(&blah.b) == *align(1:3:6) const u3);
|
||||
\\ assert(@TypeOf(&blah.b) == *align(1:3:6) const u3);
|
||||
\\}
|
||||
\\
|
||||
);
|
||||
@ -2604,7 +2604,7 @@ test "zig fmt: comments at several places in struct init" {
|
||||
try testTransform(
|
||||
\\var bar = Bar{
|
||||
\\ .x = 10, // test
|
||||
\\ .y = "test"
|
||||
\\ .y = "test"
|
||||
\\ // test
|
||||
\\};
|
||||
\\
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user