Additional replacements of @typeOf with @TypeOf

This commit is contained in:
Robin Voetter 2019-12-09 21:59:12 +01:00 committed by Andrew Kelley
parent 4b4fbe3887
commit 8c096707b7
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
3 changed files with 4 additions and 4 deletions

View File

@ -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.

View File

@ -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 {

View File

@ -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
\\};
\\