Commit 4b4fbe3887

Robin Voetter <robin@voetter.nl>
2019-12-09 21:56:19
Replace @typeOf with @TypeOf in all zig source
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
1 parent f0ee068
lib/std/atomic/queue.zig
@@ -106,7 +106,7 @@ pub fn Queue(comptime T: type) type {
         pub fn dump(self: *Self) void {
             var stderr_file = std.io.getStdErr() catch return;
             const stderr = &stderr_file.outStream().stream;
-            const Error = @typeInfo(@typeOf(stderr)).Pointer.child.Error;
+            const Error = @typeInfo(@TypeOf(stderr)).Pointer.child.Error;
 
             self.dumpToStream(Error, stderr) catch return;
         }
lib/std/atomic/stack.zig
@@ -9,7 +9,7 @@ const expect = std.testing.expect;
 pub fn Stack(comptime T: type) type {
     return struct {
         root: ?*Node,
-        lock: @typeOf(lock_init),
+        lock: @TypeOf(lock_init),
 
         const lock_init = if (builtin.single_threaded) {} else @as(u8, 0);
 
lib/std/event/group.zig
@@ -61,7 +61,7 @@ pub fn Group(comptime ReturnType: type) type {
         /// `func` must be async and have return type `ReturnType`.
         /// Thread-safe.
         pub fn call(self: *Self, comptime func: var, args: var) error{OutOfMemory}!void {
-            var frame = try self.allocator.create(@typeOf(@call(.{ .modifier = .async_kw }, func, args)));
+            var frame = try self.allocator.create(@TypeOf(@call(.{ .modifier = .async_kw }, func, args)));
             errdefer self.allocator.destroy(frame);
             const node = try self.allocator.create(AllocStack.Node);
             errdefer self.allocator.destroy(node);
lib/std/event/loop.zig
@@ -42,7 +42,7 @@ pub const Loop = struct {
             },
             else => {},
         };
-        pub const Overlapped = @typeOf(overlapped_init);
+        pub const Overlapped = @TypeOf(overlapped_init);
 
         pub const Id = enum {
             Basic,
lib/std/hash/auto_hash.zig
@@ -22,7 +22,7 @@ pub const HashStrategy = enum {
 
 /// Helper function to hash a pointer and mutate the strategy if needed.
 pub fn hashPointer(hasher: var, key: var, comptime strat: HashStrategy) void {
-    const info = @typeInfo(@typeOf(key));
+    const info = @typeInfo(@TypeOf(key));
 
     switch (info.Pointer.size) {
         builtin.TypeInfo.Pointer.Size.One => switch (strat) {
@@ -74,7 +74,7 @@ pub fn hashArray(hasher: var, key: var, comptime strat: HashStrategy) void {
 /// Provides generic hashing for any eligible type.
 /// Strategy is provided to determine if pointers should be followed or not.
 pub fn hash(hasher: var, key: var, comptime strat: HashStrategy) void {
-    const Key = @typeOf(key);
+    const Key = @TypeOf(key);
     switch (@typeInfo(Key)) {
         .NoReturn,
         .Opaque,
@@ -164,7 +164,7 @@ pub fn hash(hasher: var, key: var, comptime strat: HashStrategy) void {
 /// Only hashes `key` itself, pointers are not followed.
 /// Slices are rejected to avoid ambiguity on the user's intention.
 pub fn autoHash(hasher: var, key: var) void {
-    const Key = @typeOf(key);
+    const Key = @TypeOf(key);
     if (comptime meta.trait.isSlice(Key)) {
         comptime assert(@hasDecl(std, "StringHashMap")); // detect when the following message needs updated
         const extra_help = if (Key == []const u8)
lib/std/hash/cityhash.zig
@@ -360,9 +360,9 @@ fn SMHasherTest(comptime hash_fn: var, comptime hashbits: u32) u32 {
     var hashes: [hashbytes * 256]u8 = undefined;
     var final: [hashbytes]u8 = undefined;
 
-    @memset(@ptrCast([*]u8, &key[0]), 0, @sizeOf(@typeOf(key)));
-    @memset(@ptrCast([*]u8, &hashes[0]), 0, @sizeOf(@typeOf(hashes)));
-    @memset(@ptrCast([*]u8, &final[0]), 0, @sizeOf(@typeOf(final)));
+    @memset(@ptrCast([*]u8, &key[0]), 0, @sizeOf(@TypeOf(key)));
+    @memset(@ptrCast([*]u8, &hashes[0]), 0, @sizeOf(@TypeOf(hashes)));
+    @memset(@ptrCast([*]u8, &final[0]), 0, @sizeOf(@TypeOf(final)));
 
     var i: u32 = 0;
     while (i < 256) : (i += 1) {
@@ -370,7 +370,7 @@ fn SMHasherTest(comptime hash_fn: var, comptime hashbits: u32) u32 {
 
         var h = hash_fn(key[0..i], 256 - i);
         if (builtin.endian == builtin.Endian.Big)
-            h = @byteSwap(@typeOf(h), h);
+            h = @byteSwap(@TypeOf(h), h);
         @memcpy(@ptrCast([*]u8, &hashes[i * hashbytes]), @ptrCast([*]u8, &h), hashbytes);
     }
 
lib/std/hash/murmur.zig
@@ -285,9 +285,9 @@ fn SMHasherTest(comptime hash_fn: var, comptime hashbits: u32) u32 {
     var hashes: [hashbytes * 256]u8 = undefined;
     var final: [hashbytes]u8 = undefined;
 
-    @memset(@ptrCast([*]u8, &key[0]), 0, @sizeOf(@typeOf(key)));
-    @memset(@ptrCast([*]u8, &hashes[0]), 0, @sizeOf(@typeOf(hashes)));
-    @memset(@ptrCast([*]u8, &final[0]), 0, @sizeOf(@typeOf(final)));
+    @memset(@ptrCast([*]u8, &key[0]), 0, @sizeOf(@TypeOf(key)));
+    @memset(@ptrCast([*]u8, &hashes[0]), 0, @sizeOf(@TypeOf(hashes)));
+    @memset(@ptrCast([*]u8, &final[0]), 0, @sizeOf(@TypeOf(final)));
 
     var i: u32 = 0;
     while (i < 256) : (i += 1) {
@@ -295,7 +295,7 @@ fn SMHasherTest(comptime hash_fn: var, comptime hashbits: u32) u32 {
 
         var h = hash_fn(key[0..i], 256 - i);
         if (builtin.endian == builtin.Endian.Big)
-            h = @byteSwap(@typeOf(h), h);
+            h = @byteSwap(@TypeOf(h), h);
         @memcpy(@ptrCast([*]u8, &hashes[i * hashbytes]), @ptrCast([*]u8, &h), hashbytes);
     }
 
lib/std/http/headers.zig
@@ -367,7 +367,7 @@ pub const Headers = struct {
         options: std.fmt.FormatOptions,
         context: var,
         comptime Errors: type,
-        output: fn (@typeOf(context), []const u8) Errors!void,
+        output: fn (@TypeOf(context), []const u8) Errors!void,
     ) Errors!void {
         var it = self.iterator();
         while (it.next()) |entry| {
lib/std/json/write_stream.zig
@@ -155,7 +155,7 @@ pub fn WriteStream(comptime OutStream: type, comptime max_depth: usize) type {
             value: var,
         ) !void {
             assert(self.state[self.state_index] == State.Value);
-            switch (@typeInfo(@typeOf(value))) {
+            switch (@typeInfo(@TypeOf(value))) {
                 .Int => |info| {
                     if (info.bits < 53) {
                         try self.stream.print("{}", .{value});
@@ -257,7 +257,7 @@ test "json write stream" {
     var mem_buf: [1024 * 10]u8 = undefined;
     const allocator = &std.heap.FixedBufferAllocator.init(&mem_buf).allocator;
 
-    var w = std.json.WriteStream(@typeOf(out).Child, 10).init(out);
+    var w = std.json.WriteStream(@TypeOf(out).Child, 10).init(out);
     try w.emitJson(try getJson(allocator));
 
     const result = slice_stream.getWritten();
lib/std/math/big/int.zig
@@ -268,7 +268,7 @@ pub const Int = struct {
     /// Sets an Int to value. Value must be an primitive integer type.
     pub fn set(self: *Int, value: var) Allocator.Error!void {
         self.assertWritable();
-        const T = @typeOf(value);
+        const T = @TypeOf(value);
 
         switch (@typeInfo(T)) {
             TypeId.Int => |info| {
@@ -522,7 +522,7 @@ pub const Int = struct {
         options: std.fmt.FormatOptions,
         context: var,
         comptime FmtError: type,
-        output: fn (@typeOf(context), []const u8) FmtError!void,
+        output: fn (@TypeOf(context), []const u8) FmtError!void,
     ) FmtError!void {
         self.assertWritable();
         // TODO look at fmt and support other bases
lib/std/math/complex/abs.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the absolute value (modulus) of z.
-pub fn abs(z: var) @typeOf(z.re) {
-    const T = @typeOf(z.re);
+pub fn abs(z: var) @TypeOf(z.re) {
+    const T = @TypeOf(z.re);
     return math.hypot(T, z.re, z.im);
 }
 
lib/std/math/complex/acos.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the arc-cosine of z.
-pub fn acos(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn acos(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const q = cmath.asin(z);
     return Complex(T).new(@as(T, math.pi) / 2 - q.re, -q.im);
 }
lib/std/math/complex/acosh.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the hyperbolic arc-cosine of z.
-pub fn acosh(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn acosh(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const q = cmath.acos(z);
     return Complex(T).new(-q.im, q.re);
 }
lib/std/math/complex/arg.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the angular component (in radians) of z.
-pub fn arg(z: var) @typeOf(z.re) {
-    const T = @typeOf(z.re);
+pub fn arg(z: var) @TypeOf(z.re) {
+    const T = @TypeOf(z.re);
     return math.atan2(T, z.im, z.re);
 }
 
lib/std/math/complex/asin.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 // Returns the arc-sine of z.
-pub fn asin(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn asin(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const x = z.re;
     const y = z.im;
 
lib/std/math/complex/asinh.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the hyperbolic arc-sine of z.
-pub fn asinh(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn asinh(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const q = Complex(T).new(-z.im, z.re);
     const r = cmath.asin(q);
     return Complex(T).new(r.im, -r.re);
lib/std/math/complex/atan.zig
@@ -12,8 +12,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the arc-tangent of z.
-pub fn atan(z: var) @typeOf(z) {
-    const T = @typeOf(z.re);
+pub fn atan(z: var) @TypeOf(z) {
+    const T = @TypeOf(z.re);
     return switch (T) {
         f32 => atan32(z),
         f64 => atan64(z),
lib/std/math/complex/atanh.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the hyperbolic arc-tangent of z.
-pub fn atanh(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn atanh(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const q = Complex(T).new(-z.im, z.re);
     const r = cmath.atan(q);
     return Complex(T).new(r.im, -r.re);
lib/std/math/complex/conj.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the complex conjugate of z.
-pub fn conj(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn conj(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     return Complex(T).new(z.re, -z.im);
 }
 
lib/std/math/complex/cos.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the cosine of z.
-pub fn cos(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn cos(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const p = Complex(T).new(-z.im, z.re);
     return cmath.cosh(p);
 }
lib/std/math/complex/cosh.zig
@@ -14,8 +14,8 @@ const Complex = cmath.Complex;
 const ldexp_cexp = @import("ldexp.zig").ldexp_cexp;
 
 /// Returns the hyperbolic arc-cosine of z.
-pub fn cosh(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn cosh(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     return switch (T) {
         f32 => cosh32(z),
         f64 => cosh64(z),
lib/std/math/complex/exp.zig
@@ -14,8 +14,8 @@ const Complex = cmath.Complex;
 const ldexp_cexp = @import("ldexp.zig").ldexp_cexp;
 
 /// Returns e raised to the power of z (e^z).
-pub fn exp(z: var) @typeOf(z) {
-    const T = @typeOf(z.re);
+pub fn exp(z: var) @TypeOf(z) {
+    const T = @TypeOf(z.re);
 
     return switch (T) {
         f32 => exp32(z),
lib/std/math/complex/ldexp.zig
@@ -11,8 +11,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns exp(z) scaled to avoid overflow.
-pub fn ldexp_cexp(z: var, expt: i32) @typeOf(z) {
-    const T = @typeOf(z.re);
+pub fn ldexp_cexp(z: var, expt: i32) @TypeOf(z) {
+    const T = @TypeOf(z.re);
 
     return switch (T) {
         f32 => ldexp_cexp32(z, expt),
lib/std/math/complex/log.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the natural logarithm of z.
-pub fn log(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn log(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const r = cmath.abs(z);
     const phi = cmath.arg(z);
 
lib/std/math/complex/proj.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the projection of z onto the riemann sphere.
-pub fn proj(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn proj(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
 
     if (math.isInf(z.re) or math.isInf(z.im)) {
         return Complex(T).new(math.inf(T), math.copysign(T, 0, z.re));
lib/std/math/complex/sin.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the sine of z.
-pub fn sin(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn sin(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const p = Complex(T).new(-z.im, z.re);
     const q = cmath.sinh(p);
     return Complex(T).new(q.im, -q.re);
lib/std/math/complex/sinh.zig
@@ -14,8 +14,8 @@ const Complex = cmath.Complex;
 const ldexp_cexp = @import("ldexp.zig").ldexp_cexp;
 
 /// Returns the hyperbolic sine of z.
-pub fn sinh(z: var) @typeOf(z) {
-    const T = @typeOf(z.re);
+pub fn sinh(z: var) @TypeOf(z) {
+    const T = @TypeOf(z.re);
     return switch (T) {
         f32 => sinh32(z),
         f64 => sinh64(z),
lib/std/math/complex/sqrt.zig
@@ -12,8 +12,8 @@ const Complex = cmath.Complex;
 
 /// Returns the square root of z. The real and imaginary parts of the result have the same sign
 /// as the imaginary part of z.
-pub fn sqrt(z: var) @typeOf(z) {
-    const T = @typeOf(z.re);
+pub fn sqrt(z: var) @TypeOf(z) {
+    const T = @TypeOf(z.re);
 
     return switch (T) {
         f32 => sqrt32(z),
lib/std/math/complex/tan.zig
@@ -5,8 +5,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the tanget of z.
-pub fn tan(z: var) Complex(@typeOf(z.re)) {
-    const T = @typeOf(z.re);
+pub fn tan(z: var) Complex(@TypeOf(z.re)) {
+    const T = @TypeOf(z.re);
     const q = Complex(T).new(-z.im, z.re);
     const r = cmath.tanh(q);
     return Complex(T).new(r.im, -r.re);
lib/std/math/complex/tanh.zig
@@ -12,8 +12,8 @@ const cmath = math.complex;
 const Complex = cmath.Complex;
 
 /// Returns the hyperbolic tangent of z.
-pub fn tanh(z: var) @typeOf(z) {
-    const T = @typeOf(z.re);
+pub fn tanh(z: var) @TypeOf(z) {
+    const T = @TypeOf(z.re);
     return switch (T) {
         f32 => tanh32(z),
         f64 => tanh64(z),
lib/std/math/acos.zig
@@ -12,8 +12,8 @@ const expect = std.testing.expect;
 ///
 /// Special cases:
 ///  - acos(x)   = nan if x < -1 or x > 1
-pub fn acos(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn acos(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => acos32(x),
         f64 => acos64(x),
lib/std/math/acosh.zig
@@ -14,8 +14,8 @@ const expect = std.testing.expect;
 /// Special cases:
 ///  - acosh(x)   = snan if x < 1
 ///  - acosh(nan) = nan
-pub fn acosh(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn acosh(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => acosh32(x),
         f64 => acosh64(x),
lib/std/math/asin.zig
@@ -13,8 +13,8 @@ const expect = std.testing.expect;
 /// Special Cases:
 ///  - asin(+-0) = +-0
 ///  - asin(x)   = nan if x < -1 or x > 1
-pub fn asin(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn asin(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => asin32(x),
         f64 => asin64(x),
lib/std/math/asinh.zig
@@ -15,8 +15,8 @@ const maxInt = std.math.maxInt;
 ///  - asinh(+-0)   = +-0
 ///  - asinh(+-inf) = +-inf
 ///  - asinh(nan)   = nan
-pub fn asinh(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn asinh(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => asinh32(x),
         f64 => asinh64(x),
lib/std/math/atan.zig
@@ -13,8 +13,8 @@ const expect = std.testing.expect;
 /// Special Cases:
 ///  - atan(+-0)   = +-0
 ///  - atan(+-inf) = +-pi/2
-pub fn atan(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn atan(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => atan32(x),
         f64 => atan64(x),
lib/std/math/atanh.zig
@@ -15,8 +15,8 @@ const maxInt = std.math.maxInt;
 ///  - atanh(+-1) = +-inf with signal
 ///  - atanh(x)   = nan if |x| > 1 with signal
 ///  - atanh(nan) = nan
-pub fn atanh(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn atanh(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => atanh_32(x),
         f64 => atanh_64(x),
lib/std/math/cbrt.zig
@@ -14,8 +14,8 @@ const expect = std.testing.expect;
 ///  - cbrt(+-0)   = +-0
 ///  - cbrt(+-inf) = +-inf
 ///  - cbrt(nan)   = nan
-pub fn cbrt(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn cbrt(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => cbrt32(x),
         f64 => cbrt64(x),
lib/std/math/ceil.zig
@@ -15,8 +15,8 @@ const expect = std.testing.expect;
 ///  - ceil(+-0)   = +-0
 ///  - ceil(+-inf) = +-inf
 ///  - ceil(nan)   = nan
-pub fn ceil(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn ceil(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => ceil32(x),
         f64 => ceil64(x),
lib/std/math/cos.zig
@@ -13,8 +13,8 @@ const expect = std.testing.expect;
 /// Special Cases:
 ///  - cos(+-inf) = nan
 ///  - cos(nan)   = nan
-pub fn cos(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn cos(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => cos_(f32, x),
         f64 => cos_(f64, x),
lib/std/math/cosh.zig
@@ -17,8 +17,8 @@ const maxInt = std.math.maxInt;
 ///  - cosh(+-0)   = 1
 ///  - cosh(+-inf) = +inf
 ///  - cosh(nan)   = nan
-pub fn cosh(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn cosh(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => cosh32(x),
         f64 => cosh64(x),
lib/std/math/exp.zig
@@ -14,8 +14,8 @@ const builtin = @import("builtin");
 /// Special Cases:
 ///  - exp(+inf) = +inf
 ///  - exp(nan)  = nan
-pub fn exp(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn exp(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => exp32(x),
         f64 => exp64(x),
lib/std/math/exp2.zig
@@ -13,8 +13,8 @@ const expect = std.testing.expect;
 /// Special Cases:
 ///  - exp2(+inf) = +inf
 ///  - exp2(nan)  = nan
-pub fn exp2(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn exp2(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => exp2_32(x),
         f64 => exp2_64(x),
lib/std/math/expm1.zig
@@ -18,8 +18,8 @@ const expect = std.testing.expect;
 ///  - expm1(+inf) = +inf
 ///  - expm1(-inf) = -1
 ///  - expm1(nan)  = nan
-pub fn expm1(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn expm1(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => expm1_32(x),
         f64 => expm1_64(x),
lib/std/math/expo2.zig
@@ -7,8 +7,8 @@
 const math = @import("../math.zig");
 
 /// Returns exp(x) / 2 for x >= log(maxFloat(T)).
-pub fn expo2(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn expo2(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => expo2f(x),
         f64 => expo2d(x),
lib/std/math/fabs.zig
@@ -14,8 +14,8 @@ const maxInt = std.math.maxInt;
 /// Special Cases:
 ///  - fabs(+-inf) = +inf
 ///  - fabs(nan)   = nan
-pub fn fabs(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn fabs(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f16 => fabs16(x),
         f32 => fabs32(x),
lib/std/math/floor.zig
@@ -15,8 +15,8 @@ const math = std.math;
 ///  - floor(+-0)   = +-0
 ///  - floor(+-inf) = +-inf
 ///  - floor(nan)   = nan
-pub fn floor(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn floor(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f16 => floor16(x),
         f32 => floor32(x),
lib/std/math/frexp.zig
@@ -24,8 +24,8 @@ pub const frexp64_result = frexp_result(f64);
 ///  - frexp(+-0)   = +-0, 0
 ///  - frexp(+-inf) = +-inf, 0
 ///  - frexp(nan)   = nan, undefined
-pub fn frexp(x: var) frexp_result(@typeOf(x)) {
-    const T = @typeOf(x);
+pub fn frexp(x: var) frexp_result(@TypeOf(x)) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => frexp32(x),
         f64 => frexp64(x),
lib/std/math/ilogb.zig
@@ -17,7 +17,7 @@ const minInt = std.math.minInt;
 ///  - ilogb(0)     = maxInt(i32)
 ///  - ilogb(nan)   = maxInt(i32)
 pub fn ilogb(x: var) i32 {
-    const T = @typeOf(x);
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => ilogb32(x),
         f64 => ilogb64(x),
lib/std/math/isfinite.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
 
 /// Returns whether x is a finite value.
 pub fn isFinite(x: var) bool {
-    const T = @typeOf(x);
+    const T = @TypeOf(x);
     switch (T) {
         f16 => {
             const bits = @bitCast(u16, x);
lib/std/math/isinf.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
 
 /// Returns whether x is an infinity, ignoring sign.
 pub fn isInf(x: var) bool {
-    const T = @typeOf(x);
+    const T = @TypeOf(x);
     switch (T) {
         f16 => {
             const bits = @bitCast(u16, x);
@@ -31,7 +31,7 @@ pub fn isInf(x: var) bool {
 
 /// Returns whether x is an infinity with a positive sign.
 pub fn isPositiveInf(x: var) bool {
-    const T = @typeOf(x);
+    const T = @TypeOf(x);
     switch (T) {
         f16 => {
             return @bitCast(u16, x) == 0x7C00;
@@ -53,7 +53,7 @@ pub fn isPositiveInf(x: var) bool {
 
 /// Returns whether x is an infinity with a negative sign.
 pub fn isNegativeInf(x: var) bool {
-    const T = @typeOf(x);
+    const T = @TypeOf(x);
     switch (T) {
         f16 => {
             return @bitCast(u16, x) == 0xFC00;
lib/std/math/isnormal.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
 
 // Returns whether x has a normalized representation (i.e. integer part of mantissa is 1).
 pub fn isNormal(x: var) bool {
-    const T = @typeOf(x);
+    const T = @TypeOf(x);
     switch (T) {
         f16 => {
             const bits = @bitCast(u16, x);
lib/std/math/ln.zig
@@ -17,11 +17,11 @@ const TypeId = builtin.TypeId;
 ///  - ln(0)     = -inf
 ///  - ln(x)     = nan if x < 0
 ///  - ln(nan)   = nan
-pub fn ln(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn ln(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     switch (@typeId(T)) {
         TypeId.ComptimeFloat => {
-            return @typeOf(1.0)(ln_64(x));
+            return @TypeOf(1.0)(ln_64(x));
         },
         TypeId.Float => {
             return switch (T) {
@@ -31,7 +31,7 @@ pub fn ln(x: var) @typeOf(x) {
             };
         },
         TypeId.ComptimeInt => {
-            return @typeOf(1)(math.floor(ln_64(@as(f64, x))));
+            return @TypeOf(1)(math.floor(ln_64(@as(f64, x))));
         },
         TypeId.Int => {
             return @as(T, math.floor(ln_64(@as(f64, x))));
lib/std/math/log.zig
@@ -23,10 +23,10 @@ pub fn log(comptime T: type, base: T, x: T) T {
     const float_base = math.lossyCast(f64, base);
     switch (@typeId(T)) {
         TypeId.ComptimeFloat => {
-            return @typeOf(1.0)(math.ln(@as(f64, x)) / math.ln(float_base));
+            return @TypeOf(1.0)(math.ln(@as(f64, x)) / math.ln(float_base));
         },
         TypeId.ComptimeInt => {
-            return @typeOf(1)(math.floor(math.ln(@as(f64, x)) / math.ln(float_base)));
+            return @TypeOf(1)(math.floor(math.ln(@as(f64, x)) / math.ln(float_base)));
         },
         builtin.TypeId.Int => {
             // TODO implement integer log without using float math
lib/std/math/log10.zig
@@ -18,11 +18,11 @@ const maxInt = std.math.maxInt;
 ///  - log10(0)     = -inf
 ///  - log10(x)     = nan if x < 0
 ///  - log10(nan)   = nan
-pub fn log10(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn log10(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     switch (@typeId(T)) {
         TypeId.ComptimeFloat => {
-            return @typeOf(1.0)(log10_64(x));
+            return @TypeOf(1.0)(log10_64(x));
         },
         TypeId.Float => {
             return switch (T) {
@@ -32,7 +32,7 @@ pub fn log10(x: var) @typeOf(x) {
             };
         },
         TypeId.ComptimeInt => {
-            return @typeOf(1)(math.floor(log10_64(@as(f64, x))));
+            return @TypeOf(1)(math.floor(log10_64(@as(f64, x))));
         },
         TypeId.Int => {
             return @floatToInt(T, math.floor(log10_64(@intToFloat(f64, x))));
lib/std/math/log1p.zig
@@ -17,8 +17,8 @@ const expect = std.testing.expect;
 ///  - log1p(-1)    = -inf
 ///  - log1p(x)     = nan if x < -1
 ///  - log1p(nan)   = nan
-pub fn log1p(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn log1p(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => log1p_32(x),
         f64 => log1p_64(x),
lib/std/math/log2.zig
@@ -18,11 +18,11 @@ const maxInt = std.math.maxInt;
 ///  - log2(0)     = -inf
 ///  - log2(x)     = nan if x < 0
 ///  - log2(nan)   = nan
-pub fn log2(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn log2(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     switch (@typeId(T)) {
         TypeId.ComptimeFloat => {
-            return @typeOf(1.0)(log2_64(x));
+            return @TypeOf(1.0)(log2_64(x));
         },
         TypeId.Float => {
             return switch (T) {
lib/std/math/modf.zig
@@ -24,8 +24,8 @@ pub const modf64_result = modf_result(f64);
 /// Special Cases:
 ///  - modf(+-inf) = +-inf, nan
 ///  - modf(nan)   = nan, nan
-pub fn modf(x: var) modf_result(@typeOf(x)) {
-    const T = @typeOf(x);
+pub fn modf(x: var) modf_result(@TypeOf(x)) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => modf32(x),
         f64 => modf64(x),
lib/std/math/round.zig
@@ -15,8 +15,8 @@ const math = std.math;
 ///  - round(+-0)   = +-0
 ///  - round(+-inf) = +-inf
 ///  - round(nan)   = nan
-pub fn round(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn round(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => round32(x),
         f64 => round64(x),
lib/std/math/scalbn.zig
@@ -9,8 +9,8 @@ const math = std.math;
 const expect = std.testing.expect;
 
 /// Returns x * 2^n.
-pub fn scalbn(x: var, n: i32) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn scalbn(x: var, n: i32) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => scalbn32(x, n),
         f64 => scalbn64(x, n),
lib/std/math/signbit.zig
@@ -4,7 +4,7 @@ const expect = std.testing.expect;
 
 /// Returns whether x is negative or negative 0.
 pub fn signbit(x: var) bool {
-    const T = @typeOf(x);
+    const T = @TypeOf(x);
     return switch (T) {
         f16 => signbit16(x),
         f32 => signbit32(x),
lib/std/math/sin.zig
@@ -14,8 +14,8 @@ const expect = std.testing.expect;
 ///  - sin(+-0)   = +-0
 ///  - sin(+-inf) = nan
 ///  - sin(nan)   = nan
-pub fn sin(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn sin(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => sin_(T, x),
         f64 => sin_(T, x),
lib/std/math/sinh.zig
@@ -17,8 +17,8 @@ const maxInt = std.math.maxInt;
 ///  - sinh(+-0)   = +-0
 ///  - sinh(+-inf) = +-inf
 ///  - sinh(nan)   = nan
-pub fn sinh(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn sinh(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => sinh32(x),
         f64 => sinh64(x),
lib/std/math/sqrt.zig
@@ -12,8 +12,8 @@ const maxInt = std.math.maxInt;
 ///  - sqrt(+-0)   = +-0
 ///  - sqrt(x)     = nan if x < 0
 ///  - sqrt(nan)   = nan
-pub fn sqrt(x: var) (if (@typeId(@typeOf(x)) == TypeId.Int) @IntType(false, @typeOf(x).bit_count / 2) else @typeOf(x)) {
-    const T = @typeOf(x);
+pub fn sqrt(x: var) (if (@typeId(@TypeOf(x)) == TypeId.Int) @IntType(false, @TypeOf(x).bit_count / 2) else @TypeOf(x)) {
+    const T = @TypeOf(x);
     switch (@typeId(T)) {
         TypeId.ComptimeFloat => return @as(T, @sqrt(f64, x)), // TODO upgrade to f128
         TypeId.Float => return @sqrt(T, x),
lib/std/math/tan.zig
@@ -14,8 +14,8 @@ const expect = std.testing.expect;
 ///  - tan(+-0)   = +-0
 ///  - tan(+-inf) = nan
 ///  - tan(nan)   = nan
-pub fn tan(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn tan(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => tan_(f32, x),
         f64 => tan_(f64, x),
lib/std/math/tanh.zig
@@ -17,8 +17,8 @@ const maxInt = std.math.maxInt;
 ///  - sinh(+-0)   = +-0
 ///  - sinh(+-inf) = +-1
 ///  - sinh(nan)   = nan
-pub fn tanh(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn tanh(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => tanh32(x),
         f64 => tanh64(x),
lib/std/math/trunc.zig
@@ -15,8 +15,8 @@ const maxInt = std.math.maxInt;
 ///  - trunc(+-0)   = +-0
 ///  - trunc(+-inf) = +-inf
 ///  - trunc(nan)   = nan
-pub fn trunc(x: var) @typeOf(x) {
-    const T = @typeOf(x);
+pub fn trunc(x: var) @TypeOf(x) {
+    const T = @TypeOf(x);
     return switch (T) {
         f32 => trunc32(x),
         f64 => trunc64(x),
lib/std/meta/trait.zig
@@ -13,7 +13,7 @@ fn traitFnWorkaround(comptime T: type) bool {
     return false;
 }
 
-pub const TraitFn = @typeOf(traitFnWorkaround);
+pub const TraitFn = @TypeOf(traitFnWorkaround);
 ///
 
 //////Trait generators
@@ -61,7 +61,7 @@ pub fn hasFn(comptime name: []const u8) TraitFn {
         pub fn trait(comptime T: type) bool {
             if (!comptime isContainer(T)) return false;
             if (!comptime @hasDecl(T, name)) return false;
-            const DeclType = @typeOf(@field(T, name));
+            const DeclType = @TypeOf(@field(T, name));
             const decl_type_id = @typeId(DeclType);
             return decl_type_id == builtin.TypeId.Fn;
         }
@@ -236,9 +236,9 @@ pub fn isSingleItemPtr(comptime T: type) bool {
 
 test "std.meta.trait.isSingleItemPtr" {
     const array = [_]u8{0} ** 10;
-    testing.expect(isSingleItemPtr(@typeOf(&array[0])));
-    testing.expect(!isSingleItemPtr(@typeOf(array)));
-    testing.expect(!isSingleItemPtr(@typeOf(array[0..1])));
+    testing.expect(isSingleItemPtr(@TypeOf(&array[0])));
+    testing.expect(!isSingleItemPtr(@TypeOf(array)));
+    testing.expect(!isSingleItemPtr(@TypeOf(array[0..1])));
 }
 
 ///
@@ -253,9 +253,9 @@ pub fn isManyItemPtr(comptime T: type) bool {
 test "std.meta.trait.isManyItemPtr" {
     const array = [_]u8{0} ** 10;
     const mip = @ptrCast([*]const u8, &array[0]);
-    testing.expect(isManyItemPtr(@typeOf(mip)));
-    testing.expect(!isManyItemPtr(@typeOf(array)));
-    testing.expect(!isManyItemPtr(@typeOf(array[0..1])));
+    testing.expect(isManyItemPtr(@TypeOf(mip)));
+    testing.expect(!isManyItemPtr(@TypeOf(array)));
+    testing.expect(!isManyItemPtr(@TypeOf(array[0..1])));
 }
 
 ///
@@ -269,9 +269,9 @@ pub fn isSlice(comptime T: type) bool {
 
 test "std.meta.trait.isSlice" {
     const array = [_]u8{0} ** 10;
-    testing.expect(isSlice(@typeOf(array[0..])));
-    testing.expect(!isSlice(@typeOf(array)));
-    testing.expect(!isSlice(@typeOf(&array[0])));
+    testing.expect(isSlice(@TypeOf(array[0..])));
+    testing.expect(!isSlice(@TypeOf(array)));
+    testing.expect(!isSlice(@TypeOf(&array[0])));
 }
 
 ///
@@ -291,10 +291,10 @@ test "std.meta.trait.isIndexable" {
     const array = [_]u8{0} ** 10;
     const slice = array[0..];
 
-    testing.expect(isIndexable(@typeOf(array)));
-    testing.expect(isIndexable(@typeOf(&array)));
-    testing.expect(isIndexable(@typeOf(slice)));
-    testing.expect(!isIndexable(meta.Child(@typeOf(slice))));
+    testing.expect(isIndexable(@TypeOf(array)));
+    testing.expect(isIndexable(@TypeOf(&array)));
+    testing.expect(isIndexable(@TypeOf(slice)));
+    testing.expect(!isIndexable(meta.Child(@TypeOf(slice))));
 }
 
 ///
@@ -313,8 +313,8 @@ test "std.meta.trait.isNumber" {
     testing.expect(isNumber(u32));
     testing.expect(isNumber(f32));
     testing.expect(isNumber(u64));
-    testing.expect(isNumber(@typeOf(102)));
-    testing.expect(isNumber(@typeOf(102.123)));
+    testing.expect(isNumber(@TypeOf(102)));
+    testing.expect(isNumber(@TypeOf(102.123)));
     testing.expect(!isNumber([]u8));
     testing.expect(!isNumber(NotANumber));
 }
@@ -328,10 +328,10 @@ pub fn isConstPtr(comptime T: type) bool {
 test "std.meta.trait.isConstPtr" {
     var t = @as(u8, 0);
     const c = @as(u8, 0);
-    testing.expect(isConstPtr(*const @typeOf(t)));
-    testing.expect(isConstPtr(@typeOf(&c)));
-    testing.expect(!isConstPtr(*@typeOf(t)));
-    testing.expect(!isConstPtr(@typeOf(6)));
+    testing.expect(isConstPtr(*const @TypeOf(t)));
+    testing.expect(isConstPtr(@TypeOf(&c)));
+    testing.expect(!isConstPtr(*@TypeOf(t)));
+    testing.expect(!isConstPtr(@TypeOf(6)));
 }
 
 pub fn isContainer(comptime T: type) bool {
lib/std/os/windows/kernel32.zig
@@ -214,12 +214,12 @@ pub extern "kernel32" stdcallcc fn WaitForSingleObject(hHandle: HANDLE, dwMillis
 
 pub extern "kernel32" stdcallcc fn WaitForSingleObjectEx(hHandle: HANDLE, dwMilliseconds: DWORD, bAlertable: BOOL) DWORD;
 
-pub extern "kernel32" stdcallcc fn WaitForMultipleObjects(nCount: DWORD, lpHandle: [*]const HANDLE, bWaitAll:BOOL, dwMilliseconds: DWORD) DWORD;
+pub extern "kernel32" stdcallcc fn WaitForMultipleObjects(nCount: DWORD, lpHandle: [*]const HANDLE, bWaitAll: BOOL, dwMilliseconds: DWORD) DWORD;
 
 pub extern "kernel32" stdcallcc fn WaitForMultipleObjectsEx(
     nCount: DWORD,
     lpHandle: [*]const HANDLE,
-    bWaitAll:BOOL,
+    bWaitAll: BOOL,
     dwMilliseconds: DWORD,
     bAlertable: BOOL,
 ) DWORD;
lib/std/os/linux.zig
@@ -706,7 +706,7 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti
         .restorer = @ptrCast(extern fn () void, restorer_fn),
     };
     var ksa_old: k_sigaction = undefined;
-    const ksa_mask_size = @sizeOf(@typeOf(ksa_old.mask));
+    const ksa_mask_size = @sizeOf(@TypeOf(ksa_old.mask));
     @memcpy(@ptrCast([*]u8, &ksa.mask), @ptrCast([*]const u8, &act.mask), ksa_mask_size);
     const result = syscall4(SYS_rt_sigaction, sig, @ptrToInt(&ksa), @ptrToInt(&ksa_old), ksa_mask_size);
     const err = getErrno(result);
@@ -786,7 +786,7 @@ pub fn sendmsg(fd: i32, msg: *msghdr_const, flags: u32) usize {
 }
 
 pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize {
-    if (@typeInfo(usize).Int.bits > @typeInfo(@typeOf(mmsghdr(undefined).msg_len)).Int.bits) {
+    if (@typeInfo(usize).Int.bits > @typeInfo(@TypeOf(mmsghdr(undefined).msg_len)).Int.bits) {
         // workaround kernel brokenness:
         // if adding up all iov_len overflows a i32 then split into multiple calls
         // see https://www.openwall.com/lists/musl/2014/06/07/5
lib/std/os/uefi.zig
@@ -32,7 +32,7 @@ pub const Guid = extern struct {
         options: fmt.FormatOptions,
         context: var,
         comptime Errors: type,
-        output: fn (@typeOf(context), []const u8) Errors!void,
+        output: fn (@TypeOf(context), []const u8) Errors!void,
     ) Errors!void {
         if (f.len == 0) {
             return fmt.format(context, Errors, output, "{x:0>8}-{x:0>4}-{x:0>4}-{x:0>2}{x:0>2}-{x:0>12}", self.time_low, self.time_mid, self.time_high_and_version, self.clock_seq_high_and_reserved, self.clock_seq_low, self.node);
lib/std/special/build_runner.zig
@@ -125,7 +125,7 @@ pub fn main() !void {
 }
 
 fn runBuild(builder: *Builder) anyerror!void {
-    switch (@typeId(@typeOf(root.build).ReturnType)) {
+    switch (@typeId(@TypeOf(root.build).ReturnType)) {
         .Void => root.build(builder),
         .ErrorUnion => try root.build(builder),
         else => @compileError("expected return type of build to be 'void' or '!void'"),
lib/std/special/compiler_rt.zig
@@ -384,7 +384,7 @@ extern fn __aeabi_uidivmod(n: u32, d: u32) extern struct {
 } {
     @setRuntimeSafety(is_test);
 
-    var result: @typeOf(__aeabi_uidivmod).ReturnType = undefined;
+    var result: @TypeOf(__aeabi_uidivmod).ReturnType = undefined;
     result.q = __udivmodsi4(n, d, &result.r);
     return result;
 }
@@ -395,7 +395,7 @@ extern fn __aeabi_uldivmod(n: u64, d: u64) extern struct {
 } {
     @setRuntimeSafety(is_test);
 
-    var result: @typeOf(__aeabi_uldivmod).ReturnType = undefined;
+    var result: @TypeOf(__aeabi_uldivmod).ReturnType = undefined;
     result.q = __udivmoddi4(n, d, &result.r);
     return result;
 }
@@ -406,7 +406,7 @@ extern fn __aeabi_idivmod(n: i32, d: i32) extern struct {
 } {
     @setRuntimeSafety(is_test);
 
-    var result: @typeOf(__aeabi_idivmod).ReturnType = undefined;
+    var result: @TypeOf(__aeabi_idivmod).ReturnType = undefined;
     result.q = __divmodsi4(n, d, &result.r);
     return result;
 }
@@ -417,7 +417,7 @@ extern fn __aeabi_ldivmod(n: i64, d: i64) extern struct {
 } {
     @setRuntimeSafety(is_test);
 
-    var result: @typeOf(__aeabi_ldivmod).ReturnType = undefined;
+    var result: @TypeOf(__aeabi_ldivmod).ReturnType = undefined;
     result.q = __divmoddi4(n, d, &result.r);
     return result;
 }
lib/std/special/start.zig
@@ -25,7 +25,7 @@ comptime {
         }
     } else if (builtin.output_mode == .Exe or @hasDecl(root, "main")) {
         if (builtin.link_libc and @hasDecl(root, "main")) {
-            if (@typeInfo(@typeOf(root.main)).Fn.calling_convention != .C) {
+            if (@typeInfo(@TypeOf(root.main)).Fn.calling_convention != .C) {
                 @export("main", main, .Weak);
             }
         } else if (builtin.os == .windows) {
@@ -69,7 +69,7 @@ extern fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) u
     uefi.handle = handle;
     uefi.system_table = system_table;
 
-    switch (@typeInfo(@typeOf(root.main).ReturnType)) {
+    switch (@typeInfo(@TypeOf(root.main).ReturnType)) {
         .NoReturn => {
             root.main();
         },
@@ -248,7 +248,7 @@ async fn callMainAsync(loop: *std.event.Loop) u8 {
 // This is not marked inline because it is called with @asyncCall when
 // there is an event loop.
 fn callMain() u8 {
-    switch (@typeInfo(@typeOf(root.main).ReturnType)) {
+    switch (@typeInfo(@TypeOf(root.main).ReturnType)) {
         .NoReturn => {
             root.main();
         },
@@ -270,7 +270,7 @@ fn callMain() u8 {
                 }
                 return 1;
             };
-            switch (@typeInfo(@typeOf(result))) {
+            switch (@typeInfo(@TypeOf(result))) {
                 .Void => return 0,
                 .Int => |info| {
                     if (info.bits != 8) {
lib/std/zig/render.zig
@@ -13,19 +13,19 @@ pub const Error = error{
 };
 
 /// Returns whether anything changed
-pub fn render(allocator: *mem.Allocator, stream: var, tree: *ast.Tree) (@typeOf(stream).Child.Error || Error)!bool {
-    comptime assert(@typeId(@typeOf(stream)) == builtin.TypeId.Pointer);
+pub fn render(allocator: *mem.Allocator, stream: var, tree: *ast.Tree) (@TypeOf(stream).Child.Error || Error)!bool {
+    comptime assert(@typeId(@TypeOf(stream)) == builtin.TypeId.Pointer);
 
     var anything_changed: bool = false;
 
     // make a passthrough stream that checks whether something changed
     const MyStream = struct {
         const MyStream = @This();
-        const StreamError = @typeOf(stream).Child.Error;
+        const StreamError = @TypeOf(stream).Child.Error;
         const Stream = std.io.OutStream(StreamError);
 
         anything_changed_ptr: *bool,
-        child_stream: @typeOf(stream),
+        child_stream: @TypeOf(stream),
         stream: Stream,
         source_index: usize,
         source: []const u8,
@@ -70,7 +70,7 @@ fn renderRoot(
     allocator: *mem.Allocator,
     stream: var,
     tree: *ast.Tree,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     var tok_it = tree.tokens.iterator(0);
 
     // render all the line comments at the beginning of the file
@@ -190,7 +190,7 @@ fn renderRoot(
     }
 }
 
-fn renderExtraNewline(tree: *ast.Tree, stream: var, start_col: *usize, node: *ast.Node) @typeOf(stream).Child.Error!void {
+fn renderExtraNewline(tree: *ast.Tree, stream: var, start_col: *usize, node: *ast.Node) @TypeOf(stream).Child.Error!void {
     const first_token = node.firstToken();
     var prev_token = first_token;
     while (tree.tokens.at(prev_token - 1).id == .DocComment) {
@@ -204,7 +204,7 @@ fn renderExtraNewline(tree: *ast.Tree, stream: var, start_col: *usize, node: *as
     }
 }
 
-fn renderTopLevelDecl(allocator: *mem.Allocator, stream: var, tree: *ast.Tree, indent: usize, start_col: *usize, decl: *ast.Node) (@typeOf(stream).Child.Error || Error)!void {
+fn renderTopLevelDecl(allocator: *mem.Allocator, stream: var, tree: *ast.Tree, indent: usize, start_col: *usize, decl: *ast.Node) (@TypeOf(stream).Child.Error || Error)!void {
     switch (decl.id) {
         .FnProto => {
             const fn_proto = @fieldParentPtr(ast.Node.FnProto, "base", decl);
@@ -325,7 +325,7 @@ fn renderExpression(
     start_col: *usize,
     base: *ast.Node,
     space: Space,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     switch (base.id) {
         .Identifier => {
             const identifier = @fieldParentPtr(ast.Node.Identifier, "base", base);
@@ -1903,7 +1903,7 @@ fn renderVarDecl(
     indent: usize,
     start_col: *usize,
     var_decl: *ast.Node.VarDecl,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     if (var_decl.visib_token) |visib_token| {
         try renderToken(tree, stream, visib_token, indent, start_col, Space.Space); // pub
     }
@@ -1976,7 +1976,7 @@ fn renderParamDecl(
     start_col: *usize,
     base: *ast.Node,
     space: Space,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     const param_decl = @fieldParentPtr(ast.Node.ParamDecl, "base", base);
 
     try renderDocComments(tree, stream, param_decl, indent, start_col);
@@ -2005,7 +2005,7 @@ fn renderStatement(
     indent: usize,
     start_col: *usize,
     base: *ast.Node,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     switch (base.id) {
         .VarDecl => {
             const var_decl = @fieldParentPtr(ast.Node.VarDecl, "base", base);
@@ -2044,7 +2044,7 @@ fn renderTokenOffset(
     start_col: *usize,
     space: Space,
     token_skip_bytes: usize,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     if (space == Space.BlockStart) {
         if (start_col.* < indent + indent_delta)
             return renderToken(tree, stream, token_index, indent, start_col, Space.Space);
@@ -2232,7 +2232,7 @@ fn renderToken(
     indent: usize,
     start_col: *usize,
     space: Space,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     return renderTokenOffset(tree, stream, token_index, indent, start_col, space, 0);
 }
 
@@ -2242,7 +2242,7 @@ fn renderDocComments(
     node: var,
     indent: usize,
     start_col: *usize,
-) (@typeOf(stream).Child.Error || Error)!void {
+) (@TypeOf(stream).Child.Error || Error)!void {
     const comment = node.doc_comments orelse return;
     var it = comment.lines.iterator(0);
     const first_token = node.firstToken();
@@ -2308,7 +2308,7 @@ const FindByteOutStream = struct {
     }
 };
 
-fn copyFixingWhitespace(stream: var, slice: []const u8) @typeOf(stream).Child.Error!void {
+fn copyFixingWhitespace(stream: var, slice: []const u8) @TypeOf(stream).Child.Error!void {
     for (slice) |byte| switch (byte) {
         '\t' => try stream.write("    "),
         '\r' => {},
lib/std/array_list.zig
@@ -40,7 +40,7 @@ pub fn AlignedArrayList(comptime T: type, comptime alignment: ?u29) type {
                 .allocator = allocator,
             };
         }
-        
+
         /// Initialize with capacity to hold at least num elements.
         /// Deinitialize with `deinit` or use `toOwnedSlice`.
         pub fn initCapacity(allocator: *Allocator, num: usize) !Self {
lib/std/debug.zig
@@ -1290,7 +1290,7 @@ pub const DwarfInfo = struct {
             try di.dwarf_seekable_stream.seekTo(this_unit_offset);
 
             var is_64: bool = undefined;
-            const unit_length = try readInitialLength(@typeOf(di.dwarf_in_stream.readFn).ReturnType.ErrorSet, di.dwarf_in_stream, &is_64);
+            const unit_length = try readInitialLength(@TypeOf(di.dwarf_in_stream.readFn).ReturnType.ErrorSet, di.dwarf_in_stream, &is_64);
             if (unit_length == 0) return;
             const next_offset = unit_length + (if (is_64) @as(usize, 12) else @as(usize, 4));
 
@@ -1392,7 +1392,7 @@ pub const DwarfInfo = struct {
             try di.dwarf_seekable_stream.seekTo(this_unit_offset);
 
             var is_64: bool = undefined;
-            const unit_length = try readInitialLength(@typeOf(di.dwarf_in_stream.readFn).ReturnType.ErrorSet, di.dwarf_in_stream, &is_64);
+            const unit_length = try readInitialLength(@TypeOf(di.dwarf_in_stream.readFn).ReturnType.ErrorSet, di.dwarf_in_stream, &is_64);
             if (unit_length == 0) return;
             const next_offset = unit_length + (if (is_64) @as(usize, 12) else @as(usize, 4));
 
@@ -1551,7 +1551,7 @@ pub const DwarfInfo = struct {
         try di.dwarf_seekable_stream.seekTo(di.debug_line.offset + line_info_offset);
 
         var is_64: bool = undefined;
-        const unit_length = try readInitialLength(@typeOf(di.dwarf_in_stream.readFn).ReturnType.ErrorSet, di.dwarf_in_stream, &is_64);
+        const unit_length = try readInitialLength(@TypeOf(di.dwarf_in_stream.readFn).ReturnType.ErrorSet, di.dwarf_in_stream, &is_64);
         if (unit_length == 0) {
             return error.MissingDebugInfo;
         }
@@ -2080,7 +2080,7 @@ fn parseFormValue(allocator: *mem.Allocator, in_stream: var, form_id: u64, is_64
         DW.FORM_strp => FormValue{ .StrPtr = try parseFormValueDwarfOffsetSize(in_stream, is_64) },
         DW.FORM_indirect => {
             const child_form_id = try noasync leb.readULEB128(u64, in_stream);
-            const F = @typeOf(async parseFormValue(allocator, in_stream, child_form_id, is_64));
+            const F = @TypeOf(async parseFormValue(allocator, in_stream, child_form_id, is_64));
             var frame = try allocator.create(F);
             defer allocator.destroy(frame);
             return await @asyncCall(frame, {}, parseFormValue, allocator, in_stream, child_form_id, is_64);
lib/std/fmt.zig
@@ -89,7 +89,7 @@ fn peekIsAlign(comptime fmt: []const u8) bool {
 pub fn format(
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
     comptime fmt: []const u8,
     args: var,
 ) Errors!void {
@@ -320,17 +320,17 @@ pub fn formatType(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
     max_depth: usize,
 ) Errors!void {
     if (comptime std.mem.eql(u8, fmt, "*")) {
-        try output(context, @typeName(@typeOf(value).Child));
+        try output(context, @typeName(@TypeOf(value).Child));
         try output(context, "@");
         try formatInt(@ptrToInt(value), 16, false, FormatOptions{}, context, Errors, output);
         return;
     }
 
-    const T = @typeOf(value);
+    const T = @TypeOf(value);
     switch (@typeInfo(T)) {
         .ComptimeInt, .Int, .Float => {
             return formatValue(value, fmt, options, context, Errors, output);
@@ -478,7 +478,7 @@ fn formatValue(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     if (comptime std.mem.eql(u8, fmt, "B")) {
         return formatBytes(value, options, 1000, context, Errors, output);
@@ -486,7 +486,7 @@ fn formatValue(
         return formatBytes(value, options, 1024, context, Errors, output);
     }
 
-    const T = @typeOf(value);
+    const T = @TypeOf(value);
     switch (@typeId(T)) {
         .Float => return formatFloatValue(value, fmt, options, context, Errors, output),
         .Int, .ComptimeInt => return formatIntValue(value, fmt, options, context, Errors, output),
@@ -500,12 +500,12 @@ pub fn formatIntValue(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     comptime var radix = 10;
     comptime var uppercase = false;
 
-    const int_value = if (@typeOf(value) == comptime_int) blk: {
+    const int_value = if (@TypeOf(value) == comptime_int) blk: {
         const Int = math.IntFittingRange(value, value);
         break :blk @as(Int, value);
     } else
@@ -515,7 +515,7 @@ pub fn formatIntValue(
         radix = 10;
         uppercase = false;
     } else if (comptime std.mem.eql(u8, fmt, "c")) {
-        if (@typeOf(int_value).bit_count <= 8) {
+        if (@TypeOf(int_value).bit_count <= 8) {
             return formatAsciiChar(@as(u8, int_value), options, context, Errors, output);
         } else {
             @compileError("Cannot print integer that is larger than 8 bits as a ascii");
@@ -542,7 +542,7 @@ fn formatFloatValue(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "e")) {
         return formatFloatScientific(value, options, context, Errors, output);
@@ -559,7 +559,7 @@ pub fn formatText(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     if (fmt.len == 0) {
         return output(context, bytes);
@@ -580,7 +580,7 @@ pub fn formatAsciiChar(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     return output(context, @as(*const [1]u8, &c)[0..]);
 }
@@ -590,7 +590,7 @@ pub fn formatBuf(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     try output(context, buf);
 
@@ -610,7 +610,7 @@ pub fn formatFloatScientific(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     var x = @floatCast(f64, value);
 
@@ -672,7 +672,7 @@ pub fn formatFloatScientific(
         try output(context, float_decimal.digits[0..1]);
         try output(context, ".");
         if (float_decimal.digits.len > 1) {
-            const num_digits = if (@typeOf(value) == f32) math.min(@as(usize, 9), float_decimal.digits.len) else float_decimal.digits.len;
+            const num_digits = if (@TypeOf(value) == f32) math.min(@as(usize, 9), float_decimal.digits.len) else float_decimal.digits.len;
 
             try output(context, float_decimal.digits[1..num_digits]);
         } else {
@@ -705,7 +705,7 @@ pub fn formatFloatDecimal(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     var x = @as(f64, value);
 
@@ -851,7 +851,7 @@ pub fn formatBytes(
     comptime radix: usize,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     if (value == 0) {
         return output(context, "0B");
@@ -892,15 +892,15 @@ pub fn formatInt(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
-    const int_value = if (@typeOf(value) == comptime_int) blk: {
+    const int_value = if (@TypeOf(value) == comptime_int) blk: {
         const Int = math.IntFittingRange(value, value);
         break :blk @as(Int, value);
     } else
         value;
 
-    if (@typeOf(int_value).is_signed) {
+    if (@TypeOf(int_value).is_signed) {
         return formatIntSigned(int_value, base, uppercase, options, context, Errors, output);
     } else {
         return formatIntUnsigned(int_value, base, uppercase, options, context, Errors, output);
@@ -914,7 +914,7 @@ fn formatIntSigned(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     const new_options = FormatOptions{
         .width = if (options.width) |w| (if (w == 0) 0 else w - 1) else null,
@@ -922,7 +922,7 @@ fn formatIntSigned(
         .fill = options.fill,
     };
 
-    const uint = @IntType(false, @typeOf(value).bit_count);
+    const uint = @IntType(false, @TypeOf(value).bit_count);
     if (value < 0) {
         const minus_sign: u8 = '-';
         try output(context, @as(*const [1]u8, &minus_sign)[0..]);
@@ -945,12 +945,12 @@ fn formatIntUnsigned(
     options: FormatOptions,
     context: var,
     comptime Errors: type,
-    output: fn (@typeOf(context), []const u8) Errors!void,
+    output: fn (@TypeOf(context), []const u8) Errors!void,
 ) Errors!void {
     assert(base >= 2);
-    var buf: [math.max(@typeOf(value).bit_count, 1)]u8 = undefined;
-    const min_int_bits = comptime math.max(@typeOf(value).bit_count, @typeOf(base).bit_count);
-    const MinInt = @IntType(@typeOf(value).is_signed, min_int_bits);
+    var buf: [math.max(@TypeOf(value).bit_count, 1)]u8 = undefined;
+    const min_int_bits = comptime math.max(@TypeOf(value).bit_count, @TypeOf(base).bit_count);
+    const MinInt = @IntType(@TypeOf(value).is_signed, min_int_bits);
     var a: MinInt = value;
     var index: usize = buf.len;
 
@@ -1420,7 +1420,7 @@ test "custom" {
             options: FormatOptions,
             context: var,
             comptime Errors: type,
-            output: fn (@typeOf(context), []const u8) Errors!void,
+            output: fn (@TypeOf(context), []const u8) Errors!void,
         ) Errors!void {
             if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "p")) {
                 return std.fmt.format(context, Errors, output, "({d:.3},{d:.3})", .{ self.x, self.y });
@@ -1610,7 +1610,7 @@ test "formatIntValue with comptime_int" {
     const value: comptime_int = 123456789123456789;
 
     var buf = try std.Buffer.init(std.debug.global_allocator, "");
-    try formatIntValue(value, "", FormatOptions{}, &buf, @typeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append);
+    try formatIntValue(value, "", FormatOptions{}, &buf, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append);
     std.testing.expect(mem.eql(u8, buf.toSlice(), "123456789123456789"));
 }
 
@@ -1626,7 +1626,7 @@ test "formatType max_depth" {
             options: FormatOptions,
             context: var,
             comptime Errors: type,
-            output: fn (@typeOf(context), []const u8) Errors!void,
+            output: fn (@TypeOf(context), []const u8) Errors!void,
         ) Errors!void {
             if (fmt.len == 0) {
                 return std.fmt.format(context, Errors, output, "({d:.3},{d:.3})", .{ self.x, self.y });
@@ -1664,19 +1664,19 @@ test "formatType max_depth" {
     inst.tu.ptr = &inst.tu;
 
     var buf0 = try std.Buffer.init(std.debug.global_allocator, "");
-    try formatType(inst, "", FormatOptions{}, &buf0, @typeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 0);
+    try formatType(inst, "", FormatOptions{}, &buf0, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 0);
     std.testing.expect(mem.eql(u8, buf0.toSlice(), "S{ ... }"));
 
     var buf1 = try std.Buffer.init(std.debug.global_allocator, "");
-    try formatType(inst, "", FormatOptions{}, &buf1, @typeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 1);
+    try formatType(inst, "", FormatOptions{}, &buf1, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 1);
     std.testing.expect(mem.eql(u8, buf1.toSlice(), "S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }"));
 
     var buf2 = try std.Buffer.init(std.debug.global_allocator, "");
-    try formatType(inst, "", FormatOptions{}, &buf2, @typeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 2);
+    try formatType(inst, "", FormatOptions{}, &buf2, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 2);
     std.testing.expect(mem.eql(u8, buf2.toSlice(), "S{ .a = S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ ... } }, .e = E.Two, .vec = (10.200,2.220) }"));
 
     var buf3 = try std.Buffer.init(std.debug.global_allocator, "");
-    try formatType(inst, "", FormatOptions{}, &buf3, @typeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 3);
+    try formatType(inst, "", FormatOptions{}, &buf3, @TypeOf(std.Buffer.append).ReturnType.ErrorSet, std.Buffer.append, 3);
     std.testing.expect(mem.eql(u8, buf3.toSlice(), "S{ .a = S{ .a = S{ .a = S{ ... }, .tu = TU{ ... }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ ... } }, .e = E.Two, .vec = (10.200,2.220) }, .tu = TU{ .ptr = TU{ .ptr = TU{ ... } } }, .e = E.Two, .vec = (10.200,2.220) }"));
 }
 
lib/std/io.zig
@@ -663,7 +663,7 @@ pub fn BitOutStream(endian: builtin.Endian, comptime Error: type) type {
         pub fn writeBits(self: *Self, value: var, bits: usize) Error!void {
             if (bits == 0) return;
 
-            const U = @typeOf(value);
+            const U = @TypeOf(value);
             comptime assert(trait.isUnsignedInt(U));
 
             //by extending the buffer to a minimum of u8 we can cover a number of edge cases
@@ -962,7 +962,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing,
 
         /// Deserializes data into the type pointed to by `ptr`
         pub fn deserializeInto(self: *Self, ptr: var) !void {
-            const T = @typeOf(ptr);
+            const T = @TypeOf(ptr);
             comptime assert(trait.is(builtin.TypeId.Pointer)(T));
 
             if (comptime trait.isSlice(T) or comptime trait.isPtrTo(builtin.TypeId.Array)(T)) {
@@ -1091,7 +1091,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co
         }
 
         fn serializeInt(self: *Self, value: var) Error!void {
-            const T = @typeOf(value);
+            const T = @TypeOf(value);
             comptime assert(trait.is(builtin.TypeId.Int)(T) or trait.is(builtin.TypeId.Float)(T));
 
             const t_bit_count = comptime meta.bitCount(T);
@@ -1123,7 +1123,7 @@ pub fn Serializer(comptime endian: builtin.Endian, comptime packing: Packing, co
 
         /// Serializes the passed value into the stream
         pub fn serialize(self: *Self, value: var) Error!void {
-            const T = comptime @typeOf(value);
+            const T = comptime @TypeOf(value);
 
             if (comptime trait.isIndexable(T)) {
                 for (value) |v|
lib/std/json.zig
@@ -1038,7 +1038,7 @@ pub const Value = union(enum) {
     }
 
     pub fn dumpStream(self: @This(), stream: var, comptime max_depth: usize) !void {
-        var w = std.json.WriteStream(@typeOf(stream).Child, max_depth).init(stream);
+        var w = std.json.WriteStream(@TypeOf(stream).Child, max_depth).init(stream);
         w.newline = "";
         w.one_indent = "";
         w.space = "";
@@ -1048,7 +1048,7 @@ pub const Value = union(enum) {
     pub fn dumpStreamIndent(self: @This(), comptime indent: usize, stream: var, comptime max_depth: usize) !void {
         var one_indent = " " ** indent;
 
-        var w = std.json.WriteStream(@typeOf(stream).Child, max_depth).init(stream);
+        var w = std.json.WriteStream(@TypeOf(stream).Child, max_depth).init(stream);
         w.one_indent = one_indent;
         try w.emitJson(self);
     }
@@ -1338,7 +1338,7 @@ test "write json then parse it" {
 
     var slice_out_stream = std.io.SliceOutStream.init(&out_buffer);
     const out_stream = &slice_out_stream.stream;
-    var jw = WriteStream(@typeOf(out_stream).Child, 4).init(out_stream);
+    var jw = WriteStream(@TypeOf(out_stream).Child, 4).init(out_stream);
 
     try jw.beginObject();
 
lib/std/math.zig
@@ -95,7 +95,7 @@ pub fn approxEq(comptime T: type, x: T, y: T, epsilon: T) bool {
 
 // TODO: Hide the following in an internal module.
 pub fn forceEval(value: var) void {
-    const T = @typeOf(value);
+    const T = @TypeOf(value);
     switch (T) {
         f16 => {
             var x: f16 = undefined;
@@ -239,13 +239,13 @@ pub fn Min(comptime A: type, comptime B: type) type {
         },
         else => {},
     }
-    return @typeOf(@as(A, 0) + @as(B, 0));
+    return @TypeOf(@as(A, 0) + @as(B, 0));
 }
 
 /// Returns the smaller number. When one of the parameter's type's full range fits in the other,
 /// the return type is the smaller type.
-pub fn min(x: var, y: var) Min(@typeOf(x), @typeOf(y)) {
-    const Result = Min(@typeOf(x), @typeOf(y));
+pub fn min(x: var, y: var) Min(@TypeOf(x), @TypeOf(y)) {
+    const Result = Min(@TypeOf(x), @TypeOf(y));
     if (x < y) {
         // TODO Zig should allow this as an implicit cast because x is immutable and in this
         // scope it is known to fit in the return type.
@@ -269,33 +269,33 @@ test "math.min" {
         var a: u16 = 999;
         var b: u32 = 10;
         var result = min(a, b);
-        testing.expect(@typeOf(result) == u16);
+        testing.expect(@TypeOf(result) == u16);
         testing.expect(result == 10);
     }
     {
         var a: f64 = 10.34;
         var b: f32 = 999.12;
         var result = min(a, b);
-        testing.expect(@typeOf(result) == f64);
+        testing.expect(@TypeOf(result) == f64);
         testing.expect(result == 10.34);
     }
     {
         var a: i8 = -127;
         var b: i16 = -200;
         var result = min(a, b);
-        testing.expect(@typeOf(result) == i16);
+        testing.expect(@TypeOf(result) == i16);
         testing.expect(result == -200);
     }
     {
         const a = 10.34;
         var b: f32 = 999.12;
         var result = min(a, b);
-        testing.expect(@typeOf(result) == f32);
+        testing.expect(@TypeOf(result) == f32);
         testing.expect(result == 10.34);
     }
 }
 
-pub fn max(x: var, y: var) @typeOf(x + y) {
+pub fn max(x: var, y: var) @TypeOf(x + y) {
     return if (x > y) x else y;
 }
 
@@ -318,8 +318,8 @@ pub fn sub(comptime T: type, a: T, b: T) (error{Overflow}!T) {
     return if (@subWithOverflow(T, a, b, &answer)) error.Overflow else answer;
 }
 
-pub fn negate(x: var) !@typeOf(x) {
-    return sub(@typeOf(x), 0, x);
+pub fn negate(x: var) !@TypeOf(x) {
+    return sub(@TypeOf(x), 0, x);
 }
 
 pub fn shlExact(comptime T: type, a: T, shift_amt: Log2Int(T)) !T {
@@ -333,7 +333,7 @@ pub fn shl(comptime T: type, a: T, shift_amt: var) T {
     const abs_shift_amt = absCast(shift_amt);
     const casted_shift_amt = if (abs_shift_amt >= T.bit_count) return 0 else @intCast(Log2Int(T), abs_shift_amt);
 
-    if (@typeOf(shift_amt) == comptime_int or @typeOf(shift_amt).is_signed) {
+    if (@TypeOf(shift_amt) == comptime_int or @TypeOf(shift_amt).is_signed) {
         if (shift_amt < 0) {
             return a >> casted_shift_amt;
         }
@@ -359,7 +359,7 @@ pub fn shr(comptime T: type, a: T, shift_amt: var) T {
     const abs_shift_amt = absCast(shift_amt);
     const casted_shift_amt = if (abs_shift_amt >= T.bit_count) return 0 else @intCast(Log2Int(T), abs_shift_amt);
 
-    if (@typeOf(shift_amt) == comptime_int or @typeOf(shift_amt).is_signed) {
+    if (@TypeOf(shift_amt) == comptime_int or @TypeOf(shift_amt).is_signed) {
         if (shift_amt >= 0) {
             return a >> casted_shift_amt;
         } else {
@@ -505,12 +505,12 @@ fn testOverflow() void {
     testing.expect((shlExact(i32, 0b11, 4) catch unreachable) == 0b110000);
 }
 
-pub fn absInt(x: var) !@typeOf(x) {
-    const T = @typeOf(x);
+pub fn absInt(x: var) !@TypeOf(x) {
+    const T = @TypeOf(x);
     comptime assert(@typeId(T) == builtin.TypeId.Int); // must pass an integer to absInt
     comptime assert(T.is_signed); // must pass a signed integer to absInt
 
-    if (x == minInt(@typeOf(x))) {
+    if (x == minInt(@TypeOf(x))) {
         return error.Overflow;
     } else {
         @setRuntimeSafety(false);
@@ -654,16 +654,16 @@ fn testRem() void {
 /// Returns the absolute value of the integer parameter.
 /// Result is an unsigned integer.
 pub fn absCast(x: var) t: {
-    if (@typeOf(x) == comptime_int) {
+    if (@TypeOf(x) == comptime_int) {
         break :t comptime_int;
     } else {
-        break :t @IntType(false, @typeOf(x).bit_count);
+        break :t @IntType(false, @TypeOf(x).bit_count);
     }
 } {
-    if (@typeOf(x) == comptime_int) {
+    if (@TypeOf(x) == comptime_int) {
         return if (x < 0) -x else x;
     }
-    const uint = @IntType(false, @typeOf(x).bit_count);
+    const uint = @IntType(false, @TypeOf(x).bit_count);
     if (x >= 0) return @intCast(uint, x);
 
     return @intCast(uint, -(x + 1)) + 1;
@@ -671,23 +671,23 @@ pub fn absCast(x: var) t: {
 
 test "math.absCast" {
     testing.expect(absCast(@as(i32, -999)) == 999);
-    testing.expect(@typeOf(absCast(@as(i32, -999))) == u32);
+    testing.expect(@TypeOf(absCast(@as(i32, -999))) == u32);
 
     testing.expect(absCast(@as(i32, 999)) == 999);
-    testing.expect(@typeOf(absCast(@as(i32, 999))) == u32);
+    testing.expect(@TypeOf(absCast(@as(i32, 999))) == u32);
 
     testing.expect(absCast(@as(i32, minInt(i32))) == -minInt(i32));
-    testing.expect(@typeOf(absCast(@as(i32, minInt(i32)))) == u32);
+    testing.expect(@TypeOf(absCast(@as(i32, minInt(i32)))) == u32);
 
     testing.expect(absCast(-999) == 999);
 }
 
 /// Returns the negation of the integer parameter.
 /// Result is a signed integer.
-pub fn negateCast(x: var) !@IntType(true, @typeOf(x).bit_count) {
-    if (@typeOf(x).is_signed) return negate(x);
+pub fn negateCast(x: var) !@IntType(true, @TypeOf(x).bit_count) {
+    if (@TypeOf(x).is_signed) return negate(x);
 
-    const int = @IntType(true, @typeOf(x).bit_count);
+    const int = @IntType(true, @TypeOf(x).bit_count);
     if (x > -minInt(int)) return error.Overflow;
 
     if (x == -minInt(int)) return minInt(int);
@@ -697,10 +697,10 @@ pub fn negateCast(x: var) !@IntType(true, @typeOf(x).bit_count) {
 
 test "math.negateCast" {
     testing.expect((negateCast(@as(u32, 999)) catch unreachable) == -999);
-    testing.expect(@typeOf(negateCast(@as(u32, 999)) catch unreachable) == i32);
+    testing.expect(@TypeOf(negateCast(@as(u32, 999)) catch unreachable) == i32);
 
     testing.expect((negateCast(@as(u32, -minInt(i32))) catch unreachable) == minInt(i32));
-    testing.expect(@typeOf(negateCast(@as(u32, -minInt(i32))) catch unreachable) == i32);
+    testing.expect(@TypeOf(negateCast(@as(u32, -minInt(i32))) catch unreachable) == i32);
 
     testing.expectError(error.Overflow, negateCast(@as(u32, maxInt(i32) + 10)));
 }
@@ -709,10 +709,10 @@ test "math.negateCast" {
 /// return an error.
 pub fn cast(comptime T: type, x: var) (error{Overflow}!T) {
     comptime assert(@typeId(T) == builtin.TypeId.Int); // must pass an integer
-    comptime assert(@typeId(@typeOf(x)) == builtin.TypeId.Int); // must pass an integer
-    if (maxInt(@typeOf(x)) > maxInt(T) and x > maxInt(T)) {
+    comptime assert(@typeId(@TypeOf(x)) == builtin.TypeId.Int); // must pass an integer
+    if (maxInt(@TypeOf(x)) > maxInt(T) and x > maxInt(T)) {
         return error.Overflow;
-    } else if (minInt(@typeOf(x)) < minInt(T) and x < minInt(T)) {
+    } else if (minInt(@TypeOf(x)) < minInt(T) and x < minInt(T)) {
         return error.Overflow;
     } else {
         return @intCast(T, x);
@@ -726,13 +726,13 @@ test "math.cast" {
     testing.expectError(error.Overflow, cast(u64, @as(i8, -1)));
 
     testing.expect((try cast(u8, @as(u32, 255))) == @as(u8, 255));
-    testing.expect(@typeOf(try cast(u8, @as(u32, 255))) == u8);
+    testing.expect(@TypeOf(try cast(u8, @as(u32, 255))) == u8);
 }
 
 pub const AlignCastError = error{UnalignedMemory};
 
 /// Align cast a pointer but return an error if it's the wrong alignment
-pub fn alignCast(comptime alignment: u29, ptr: var) AlignCastError!@typeOf(@alignCast(alignment, ptr)) {
+pub fn alignCast(comptime alignment: u29, ptr: var) AlignCastError!@TypeOf(@alignCast(alignment, ptr)) {
     const addr = @ptrToInt(ptr);
     if (addr % alignment != 0) {
         return error.UnalignedMemory;
@@ -858,7 +858,7 @@ test "std.math.log2_int_ceil" {
 }
 
 pub fn lossyCast(comptime T: type, value: var) T {
-    switch (@typeInfo(@typeOf(value))) {
+    switch (@typeInfo(@TypeOf(value))) {
         builtin.TypeId.Int => return @intToFloat(T, value),
         builtin.TypeId.Float => return @floatCast(T, value),
         builtin.TypeId.ComptimeInt => return @as(T, value),
lib/std/mem.zig
@@ -86,7 +86,7 @@ pub const Allocator = struct {
     /// `ptr` should be the return value of `create`, or otherwise
     /// have the same address and alignment property.
     pub fn destroy(self: *Allocator, ptr: var) void {
-        const T = @typeOf(ptr).Child;
+        const T = @TypeOf(ptr).Child;
         if (@sizeOf(T) == 0) return;
         const non_const_ptr = @intToPtr([*]u8, @ptrToInt(ptr));
         const shrink_result = self.shrinkFn(self, non_const_ptr[0..@sizeOf(T)], @alignOf(T), 0, 1);
@@ -147,10 +147,10 @@ pub const Allocator = struct {
     /// If you need guaranteed success, call `shrink`.
     /// If `new_n` is 0, this is the same as `free` and it always succeeds.
     pub fn realloc(self: *Allocator, old_mem: var, new_n: usize) t: {
-        const Slice = @typeInfo(@typeOf(old_mem)).Pointer;
+        const Slice = @typeInfo(@TypeOf(old_mem)).Pointer;
         break :t Error![]align(Slice.alignment) Slice.child;
     } {
-        const old_alignment = @typeInfo(@typeOf(old_mem)).Pointer.alignment;
+        const old_alignment = @typeInfo(@TypeOf(old_mem)).Pointer.alignment;
         return self.alignedRealloc(old_mem, old_alignment, new_n);
     }
 
@@ -162,8 +162,8 @@ pub const Allocator = struct {
         old_mem: var,
         comptime new_alignment: u29,
         new_n: usize,
-    ) Error![]align(new_alignment) @typeInfo(@typeOf(old_mem)).Pointer.child {
-        const Slice = @typeInfo(@typeOf(old_mem)).Pointer;
+    ) Error![]align(new_alignment) @typeInfo(@TypeOf(old_mem)).Pointer.child {
+        const Slice = @typeInfo(@TypeOf(old_mem)).Pointer;
         const T = Slice.child;
         if (old_mem.len == 0) {
             return self.alignedAlloc(T, new_alignment, new_n);
@@ -189,10 +189,10 @@ pub const Allocator = struct {
     /// Returned slice has same alignment as old_mem.
     /// Shrinking to 0 is the same as calling `free`.
     pub fn shrink(self: *Allocator, old_mem: var, new_n: usize) t: {
-        const Slice = @typeInfo(@typeOf(old_mem)).Pointer;
+        const Slice = @typeInfo(@TypeOf(old_mem)).Pointer;
         break :t []align(Slice.alignment) Slice.child;
     } {
-        const old_alignment = @typeInfo(@typeOf(old_mem)).Pointer.alignment;
+        const old_alignment = @typeInfo(@TypeOf(old_mem)).Pointer.alignment;
         return self.alignedShrink(old_mem, old_alignment, new_n);
     }
 
@@ -204,8 +204,8 @@ pub const Allocator = struct {
         old_mem: var,
         comptime new_alignment: u29,
         new_n: usize,
-    ) []align(new_alignment) @typeInfo(@typeOf(old_mem)).Pointer.child {
-        const Slice = @typeInfo(@typeOf(old_mem)).Pointer;
+    ) []align(new_alignment) @typeInfo(@TypeOf(old_mem)).Pointer.child {
+        const Slice = @typeInfo(@TypeOf(old_mem)).Pointer;
         const T = Slice.child;
 
         if (new_n == 0) {
@@ -229,7 +229,7 @@ pub const Allocator = struct {
     /// Free an array allocated with `alloc`. To free a single item,
     /// see `destroy`.
     pub fn free(self: *Allocator, memory: var) void {
-        const Slice = @typeInfo(@typeOf(memory)).Pointer;
+        const Slice = @typeInfo(@TypeOf(memory)).Pointer;
         const bytes = @sliceToBytes(memory);
         if (bytes.len == 0) return;
         const non_const_ptr = @intToPtr([*]u8, @ptrToInt(bytes.ptr));
@@ -1323,8 +1323,8 @@ fn AsBytesReturnType(comptime P: type) type {
 }
 
 ///Given a pointer to a single item, returns a slice of the underlying bytes, preserving constness.
-pub fn asBytes(ptr: var) AsBytesReturnType(@typeOf(ptr)) {
-    const P = @typeOf(ptr);
+pub fn asBytes(ptr: var) AsBytesReturnType(@TypeOf(ptr)) {
+    const P = @TypeOf(ptr);
     return @ptrCast(AsBytesReturnType(P), ptr);
 }
 
@@ -1363,7 +1363,7 @@ test "asBytes" {
 }
 
 ///Given any value, returns a copy of its bytes in an array.
-pub fn toBytes(value: var) [@sizeOf(@typeOf(value))]u8 {
+pub fn toBytes(value: var) [@sizeOf(@TypeOf(value))]u8 {
     return asBytes(&value).*;
 }
 
@@ -1397,8 +1397,8 @@ fn BytesAsValueReturnType(comptime T: type, comptime B: type) type {
 
 ///Given a pointer to an array of bytes, returns a pointer to a value of the specified type
 /// backed by those bytes, preserving constness.
-pub fn bytesAsValue(comptime T: type, bytes: var) BytesAsValueReturnType(T, @typeOf(bytes)) {
-    return @ptrCast(BytesAsValueReturnType(T, @typeOf(bytes)), bytes);
+pub fn bytesAsValue(comptime T: type, bytes: var) BytesAsValueReturnType(T, @TypeOf(bytes)) {
+    return @ptrCast(BytesAsValueReturnType(T, @TypeOf(bytes)), bytes);
 }
 
 test "bytesAsValue" {
@@ -1460,11 +1460,11 @@ fn SubArrayPtrReturnType(comptime T: type, comptime length: usize) type {
 }
 
 ///Given a pointer to an array, returns a pointer to a portion of that array, preserving constness.
-pub fn subArrayPtr(ptr: var, comptime start: usize, comptime length: usize) SubArrayPtrReturnType(@typeOf(ptr), length) {
+pub fn subArrayPtr(ptr: var, comptime start: usize, comptime length: usize) SubArrayPtrReturnType(@TypeOf(ptr), length) {
     assert(start + length <= ptr.*.len);
 
-    const ReturnType = SubArrayPtrReturnType(@typeOf(ptr), length);
-    const T = meta.Child(meta.Child(@typeOf(ptr)));
+    const ReturnType = SubArrayPtrReturnType(@TypeOf(ptr), length);
+    const T = meta.Child(meta.Child(@TypeOf(ptr)));
     return @ptrCast(ReturnType, &ptr[start]);
 }
 
lib/std/meta.zig
@@ -11,7 +11,7 @@ const TypeId = builtin.TypeId;
 const TypeInfo = builtin.TypeInfo;
 
 pub fn tagName(v: var) []const u8 {
-    const T = @typeOf(v);
+    const T = @TypeOf(v);
     switch (@typeInfo(T)) {
         TypeId.ErrorSet => return @errorName(v),
         else => return @tagName(v),
@@ -339,8 +339,8 @@ test "std.meta.TagType" {
 }
 
 ///Returns the active tag of a tagged union
-pub fn activeTag(u: var) @TagType(@typeOf(u)) {
-    const T = @typeOf(u);
+pub fn activeTag(u: var) @TagType(@TypeOf(u)) {
+    const T = @TypeOf(u);
     return @as(@TagType(T), u);
 }
 
@@ -365,7 +365,7 @@ test "std.meta.activeTag" {
 ///Given a tagged union type, and an enum, return the type of the union
 /// field corresponding to the enum tag.
 pub fn TagPayloadType(comptime U: type, tag: var) type {
-    const Tag = @typeOf(tag);
+    const Tag = @TypeOf(tag);
     testing.expect(trait.is(builtin.TypeId.Union)(U));
     testing.expect(trait.is(builtin.TypeId.Enum)(Tag));
 
@@ -386,13 +386,13 @@ test "std.meta.TagPayloadType" {
     };
     const MovedEvent = TagPayloadType(Event, Event.Moved);
     var e: Event = undefined;
-    testing.expect(MovedEvent == @typeOf(e.Moved));
+    testing.expect(MovedEvent == @TypeOf(e.Moved));
 }
 
 ///Compares two of any type for equality. Containers are compared on a field-by-field basis,
 /// where possible. Pointers are not followed.
-pub fn eql(a: var, b: @typeOf(a)) bool {
-    const T = @typeOf(a);
+pub fn eql(a: var, b: @TypeOf(a)) bool {
+    const T = @TypeOf(a);
 
     switch (@typeId(T)) {
         builtin.TypeId.Struct => {
lib/std/mutex.zig
@@ -11,7 +11,7 @@ const ResetEvent = std.ResetEvent;
 /// no-ops. In single threaded debug mode, there is deadlock detection.
 pub const Mutex = if (builtin.single_threaded)
     struct {
-        lock: @typeOf(lock_init),
+        lock: @TypeOf(lock_init),
 
         const lock_init = if (std.debug.runtime_safety) false else {};
 
lib/std/net.zig
@@ -271,7 +271,7 @@ pub const Address = extern union {
         options: std.fmt.FormatOptions,
         context: var,
         comptime Errors: type,
-        output: fn (@typeOf(context), []const u8) Errors!void,
+        output: fn (@TypeOf(context), []const u8) Errors!void,
     ) !void {
         switch (self.any.family) {
             os.AF_INET => {
lib/std/os.zig
@@ -2974,7 +2974,7 @@ pub fn res_mkquery(
     // Make a reasonably unpredictable id
     var ts: timespec = undefined;
     clock_gettime(CLOCK_REALTIME, &ts) catch {};
-    const UInt = @IntType(false, @typeOf(ts.tv_nsec).bit_count);
+    const UInt = @IntType(false, @TypeOf(ts.tv_nsec).bit_count);
     const unsec = @bitCast(UInt, ts.tv_nsec);
     const id = @truncate(u32, unsec + unsec / 65536);
     q[0] = @truncate(u8, id / 256);
lib/std/pdb.zig
@@ -635,7 +635,7 @@ const MsfStream = struct {
     /// Implementation of InStream trait for Pdb.MsfStream
     stream: Stream = undefined,
 
-    pub const Error = @typeOf(read).ReturnType.ErrorSet;
+    pub const Error = @TypeOf(read).ReturnType.ErrorSet;
     pub const Stream = io.InStream(Error);
 
     fn init(block_size: u32, file: File, blocks: []u32) MsfStream {
lib/std/reset_event.zig
@@ -27,7 +27,7 @@ pub const ResetEvent = struct {
     pub fn isSet(self: *ResetEvent) bool {
         return self.os_event.isSet();
     }
-    
+
     /// Sets the event if not already set and
     /// wakes up AT LEAST one thread waiting the event.
     /// Returns whether or not a thread was woken up.
@@ -62,7 +62,7 @@ const OsEvent = if (builtin.single_threaded) DebugEvent else switch (builtin.os)
 };
 
 const DebugEvent = struct {
-    is_set: @typeOf(set_init),
+    is_set: @TypeOf(set_init),
 
     const set_init = if (std.debug.runtime_safety) false else {};
 
@@ -345,8 +345,8 @@ const PosixEvent = struct {
                 timeout_abs += @intCast(u64, ts.tv_sec) * time.second;
                 timeout_abs += @intCast(u64, ts.tv_nsec);
             }
-            ts.tv_sec = @intCast(@typeOf(ts.tv_sec), @divFloor(timeout_abs, time.second));
-            ts.tv_nsec = @intCast(@typeOf(ts.tv_nsec), @mod(timeout_abs, time.second));
+            ts.tv_sec = @intCast(@TypeOf(ts.tv_sec), @divFloor(timeout_abs, time.second));
+            ts.tv_nsec = @intCast(@TypeOf(ts.tv_nsec), @mod(timeout_abs, time.second));
         }
 
         var dummy_value: u32 = undefined;
@@ -426,8 +426,8 @@ test "std.ResetEvent" {
         .event = event,
         .value = 0,
     };
-    
+
     var receiver = try std.Thread.spawn(&context, Context.receiver);
     defer receiver.wait();
     try context.sender();
-}
\ No newline at end of file
+}
lib/std/segmented_list.zig
@@ -122,7 +122,7 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
             self.* = undefined;
         }
 
-        pub fn at(self: var, i: usize) AtType(@typeOf(self)) {
+        pub fn at(self: var, i: usize) AtType(@TypeOf(self)) {
             assert(i < self.len);
             return self.uncheckedAt(i);
         }
@@ -213,7 +213,7 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
             self.len = new_len;
         }
 
-        pub fn uncheckedAt(self: var, index: usize) AtType(@typeOf(self)) {
+        pub fn uncheckedAt(self: var, index: usize) AtType(@TypeOf(self)) {
             if (index < prealloc_item_count) {
                 return &self.prealloc_segment[index];
             }
lib/std/testing.zig
@@ -21,14 +21,14 @@ pub fn expectError(expected_error: anyerror, actual_error_union: var) void {
 /// equal, prints diagnostics to stderr to show exactly how they are not equal,
 /// then aborts.
 /// The types must match exactly.
-pub fn expectEqual(expected: var, actual: @typeOf(expected)) void {
-    switch (@typeInfo(@typeOf(actual))) {
+pub fn expectEqual(expected: var, actual: @TypeOf(expected)) void {
+    switch (@typeInfo(@TypeOf(actual))) {
         .NoReturn,
         .BoundFn,
         .Opaque,
         .Frame,
         .AnyFrame,
-        => @compileError("value of type " ++ @typeName(@typeOf(actual)) ++ " encountered"),
+        => @compileError("value of type " ++ @typeName(@TypeOf(actual)) ++ " encountered"),
 
         .Undefined,
         .Null,
@@ -87,7 +87,7 @@ pub fn expectEqual(expected: var, actual: @typeOf(expected)) void {
                 @compileError("Unable to compare untagged union values");
             }
 
-            const TagType = @TagType(@typeOf(expected));
+            const TagType = @TagType(@TypeOf(expected));
 
             const expectedTag = @as(TagType, expected);
             const actualTag = @as(TagType, actual);
@@ -95,7 +95,7 @@ pub fn expectEqual(expected: var, actual: @typeOf(expected)) void {
             expectEqual(expectedTag, actualTag);
 
             // we only reach this loop if the tags are equal
-            inline for (std.meta.fields(@typeOf(actual))) |fld| {
+            inline for (std.meta.fields(@TypeOf(actual))) |fld| {
                 if (std.mem.eql(u8, fld.name, @tagName(actualTag))) {
                     expectEqual(@field(expected, fld.name), @field(actual, fld.name));
                     return;
lib/std/thread.zig
@@ -147,8 +147,8 @@ pub const Thread = struct {
         // https://github.com/ziglang/zig/issues/157
         const default_stack_size = 16 * 1024 * 1024;
 
-        const Context = @typeOf(context);
-        comptime assert(@ArgType(@typeOf(startFn), 0) == Context);
+        const Context = @TypeOf(context);
+        comptime assert(@ArgType(@TypeOf(startFn), 0) == Context);
 
         if (builtin.os == builtin.Os.windows) {
             const WinThread = struct {
@@ -158,7 +158,7 @@ pub const Thread = struct {
                 };
                 extern fn threadMain(raw_arg: windows.LPVOID) windows.DWORD {
                     const arg = if (@sizeOf(Context) == 0) {} else @ptrCast(*Context, @alignCast(@alignOf(Context), raw_arg)).*;
-                    switch (@typeId(@typeOf(startFn).ReturnType)) {
+                    switch (@typeId(@TypeOf(startFn).ReturnType)) {
                         .Int => {
                             return startFn(arg);
                         },
@@ -201,7 +201,7 @@ pub const Thread = struct {
             extern fn linuxThreadMain(ctx_addr: usize) u8 {
                 const arg = if (@sizeOf(Context) == 0) {} else @intToPtr(*const Context, ctx_addr).*;
 
-                switch (@typeId(@typeOf(startFn).ReturnType)) {
+                switch (@typeId(@TypeOf(startFn).ReturnType)) {
                     .Int => {
                         return startFn(arg);
                     },
src-self-hosted/dep_tokenizer.zig
@@ -1021,8 +1021,8 @@ comptime {
 // output: must be a function that takes a `self` idiom parameter
 // and a bytes parameter
 // context: must be that self
-fn makeOutput(output: var, context: var) Output(@typeOf(output)) {
-    return Output(@typeOf(output)){
+fn makeOutput(output: var, context: var) Output(@TypeOf(output)) {
+    return Output(@TypeOf(output)){
         .output = output,
         .context = context,
     };
src-self-hosted/ir.zig
@@ -1807,7 +1807,7 @@ pub const Builder = struct {
         // Look at the params and ref() other instructions
         comptime var i = 0;
         inline while (i < @memberCount(I.Params)) : (i += 1) {
-            const FieldType = comptime @typeOf(@field(@as(I.Params, undefined), @memberName(I.Params, i)));
+            const FieldType = comptime @TypeOf(@field(@as(I.Params, undefined), @memberName(I.Params, i)));
             switch (FieldType) {
                 *Inst => @field(inst.params, @memberName(I.Params, i)).ref(self),
                 *BasicBlock => @field(inst.params, @memberName(I.Params, i)).ref(self),
src-self-hosted/libc_installation.zig
@@ -72,7 +72,7 @@ pub const LibCInstallation = struct {
             inline for (keys) |key, i| {
                 if (std.mem.eql(u8, name, key)) {
                     found_keys[i].found = true;
-                    switch (@typeInfo(@typeOf(@field(self, key)))) {
+                    switch (@typeInfo(@TypeOf(@field(self, key)))) {
                         .Optional => {
                             if (value.len == 0) {
                                 @field(self, key) = null;
src-self-hosted/translate_c.zig
@@ -1147,7 +1147,7 @@ fn transCreateNodeAPInt(c: *Context, int: ?*const ZigClangAPSInt) !*ast.Node {
     var big = try std.math.big.Int.initCapacity(c.a(), num_limbs);
     defer big.deinit();
     const data = ZigClangAPSInt_getRawData(int.?);
-    var i: @typeOf(num_limbs) = 0;
+    var i: @TypeOf(num_limbs) = 0;
     while (i < num_limbs) : (i += 1) big.limbs[i] = data[i];
     const str = big.toString(c.a(), 10) catch |err| switch (err) {
         error.OutOfMemory => return error.OutOfMemory,
@@ -1416,7 +1416,7 @@ fn revertAndWarn(
     source_loc: ZigClangSourceLocation,
     comptime format: []const u8,
     args: var,
-) (@typeOf(err) || error{OutOfMemory}) {
+) (@TypeOf(err) || error{OutOfMemory}) {
     rp.activate();
     try emitWarning(rp.c, source_loc, format, args);
     return err;
src-self-hosted/type.zig
@@ -1038,14 +1038,14 @@ pub const Type = struct {
 };
 
 fn hashAny(x: var, comptime seed: u64) u32 {
-    switch (@typeInfo(@typeOf(x))) {
+    switch (@typeInfo(@TypeOf(x))) {
         .Int => |info| {
             comptime var rng = comptime std.rand.DefaultPrng.init(seed);
             const unsigned_x = @bitCast(@IntType(false, info.bits), x);
             if (info.bits <= 32) {
                 return @as(u32, unsigned_x) *% comptime rng.random.scalar(u32);
             } else {
-                return @truncate(u32, unsigned_x *% comptime rng.random.scalar(@typeOf(unsigned_x)));
+                return @truncate(u32, unsigned_x *% comptime rng.random.scalar(@TypeOf(unsigned_x)));
             }
         },
         .Pointer => |info| {
@@ -1069,6 +1069,6 @@ fn hashAny(x: var, comptime seed: u64) u32 {
                 return hashAny(@as(u32, 1), seed);
             }
         },
-        else => @compileError("implement hash function for " ++ @typeName(@typeOf(x))),
+        else => @compileError("implement hash function for " ++ @typeName(@TypeOf(x))),
     }
 }
test/stage1/behavior/bugs/1851.zig
@@ -15,7 +15,7 @@ test "allocation and looping over 3-byte integer" {
     x[1] = 0xFFFFFF;
 
     const bytes = @sliceToBytes(x);
-    expect(@typeOf(bytes) == []align(4) u8);
+    expect(@TypeOf(bytes) == []align(4) u8);
     expect(bytes.len == 8);
 
     for (bytes) |*b| {
test/stage1/behavior/bugs/2114.zig
@@ -3,7 +3,7 @@ const expect = std.testing.expect;
 const math = std.math;
 
 fn ctz(x: var) usize {
-    return @ctz(@typeOf(x), x);
+    return @ctz(@TypeOf(x), x);
 }
 
 test "fixed" {
test/stage1/behavior/bugs/3742.zig
@@ -24,7 +24,7 @@ pub fn isCommand(comptime T: type) bool {
 
 pub const ArgSerializer = struct {
     pub fn serializeCommand(command: var) void {
-        const CmdT = @typeOf(command);
+        const CmdT = @TypeOf(command);
 
         if (comptime isCommand(CmdT)) {
             // COMMENTING THE NEXT LINE REMOVES THE ERROR
test/stage1/behavior/bugs/655.zig
@@ -3,7 +3,7 @@ const other_file = @import("655_other_file.zig");
 
 test "function with *const parameter with type dereferenced by namespace" {
     const x: other_file.Integer = 1234;
-    comptime std.testing.expect(@typeOf(&x) == *const other_file.Integer);
+    comptime std.testing.expect(@TypeOf(&x) == *const other_file.Integer);
     foo(&x);
 }
 
test/stage1/behavior/bugs/718.zig
@@ -9,7 +9,7 @@ const Keys = struct {
 };
 var keys: Keys = undefined;
 test "zero keys with @memset" {
-    @memset(@ptrCast([*]u8, &keys), 0, @sizeOf(@typeOf(keys)));
+    @memset(@ptrCast([*]u8, &keys), 0, @sizeOf(@TypeOf(keys)));
     expect(!keys.up);
     expect(!keys.down);
     expect(!keys.left);
test/stage1/behavior/align.zig
@@ -5,10 +5,10 @@ const builtin = @import("builtin");
 var foo: u8 align(4) = 100;
 
 test "global variable alignment" {
-    expect(@typeOf(&foo).alignment == 4);
-    expect(@typeOf(&foo) == *align(4) u8);
+    expect(@TypeOf(&foo).alignment == 4);
+    expect(@TypeOf(&foo) == *align(4) u8);
     const slice = @as(*[1]u8, &foo)[0..];
-    expect(@typeOf(slice) == []align(4) u8);
+    expect(@TypeOf(slice) == []align(4) u8);
 }
 
 fn derp() align(@sizeOf(usize) * 2) i32 {
@@ -19,8 +19,8 @@ fn noop4() align(4) void {}
 
 test "function alignment" {
     expect(derp() == 1234);
-    expect(@typeOf(noop1) == fn () align(1) void);
-    expect(@typeOf(noop4) == fn () align(4) void);
+    expect(@TypeOf(noop1) == fn () align(1) void);
+    expect(@TypeOf(noop4) == fn () align(4) void);
     noop1();
     noop4();
 }
@@ -31,7 +31,7 @@ var baz: packed struct {
 } = undefined;
 
 test "packed struct alignment" {
-    expect(@typeOf(&baz.b) == *align(1) u32);
+    expect(@TypeOf(&baz.b) == *align(1) u32);
 }
 
 const blah: packed struct {
@@ -41,7 +41,7 @@ const blah: packed struct {
 } = undefined;
 
 test "bit field alignment" {
-    expect(@typeOf(&blah.b) == *align(1:3:1) const u3);
+    expect(@TypeOf(&blah.b) == *align(1:3:1) const u3);
 }
 
 test "default alignment allows unspecified in type syntax" {
@@ -165,28 +165,28 @@ fn whyWouldYouEverDoThis(comptime align_bytes: u8) align(align_bytes) u8 {
 test "@ptrCast preserves alignment of bigger source" {
     var x: u32 align(16) = 1234;
     const ptr = @ptrCast(*u8, &x);
-    expect(@typeOf(ptr) == *align(16) u8);
+    expect(@TypeOf(ptr) == *align(16) u8);
 }
 
 test "runtime known array index has best alignment possible" {
     // take full advantage of over-alignment
     var array align(4) = [_]u8{ 1, 2, 3, 4 };
-    expect(@typeOf(&array[0]) == *align(4) u8);
-    expect(@typeOf(&array[1]) == *u8);
-    expect(@typeOf(&array[2]) == *align(2) u8);
-    expect(@typeOf(&array[3]) == *u8);
+    expect(@TypeOf(&array[0]) == *align(4) u8);
+    expect(@TypeOf(&array[1]) == *u8);
+    expect(@TypeOf(&array[2]) == *align(2) u8);
+    expect(@TypeOf(&array[3]) == *u8);
 
     // because align is too small but we still figure out to use 2
     var bigger align(2) = [_]u64{ 1, 2, 3, 4 };
-    expect(@typeOf(&bigger[0]) == *align(2) u64);
-    expect(@typeOf(&bigger[1]) == *align(2) u64);
-    expect(@typeOf(&bigger[2]) == *align(2) u64);
-    expect(@typeOf(&bigger[3]) == *align(2) u64);
+    expect(@TypeOf(&bigger[0]) == *align(2) u64);
+    expect(@TypeOf(&bigger[1]) == *align(2) u64);
+    expect(@TypeOf(&bigger[2]) == *align(2) u64);
+    expect(@TypeOf(&bigger[3]) == *align(2) u64);
 
     // because pointer is align 2 and u32 align % 2 == 0 we can assume align 2
     var smaller align(2) = [_]u32{ 1, 2, 3, 4 };
-    comptime expect(@typeOf(smaller[0..]) == []align(2) u32);
-    comptime expect(@typeOf(smaller[0..].ptr) == [*]align(2) u32);
+    comptime expect(@TypeOf(smaller[0..]) == []align(2) u32);
+    comptime expect(@TypeOf(smaller[0..].ptr) == [*]align(2) u32);
     testIndex(smaller[0..].ptr, 0, *align(2) u32);
     testIndex(smaller[0..].ptr, 1, *align(2) u32);
     testIndex(smaller[0..].ptr, 2, *align(2) u32);
@@ -199,10 +199,10 @@ test "runtime known array index has best alignment possible" {
     testIndex2(array[0..].ptr, 3, *u8);
 }
 fn testIndex(smaller: [*]align(2) u32, index: usize, comptime T: type) void {
-    comptime expect(@typeOf(&smaller[index]) == T);
+    comptime expect(@TypeOf(&smaller[index]) == T);
 }
 fn testIndex2(ptr: [*]align(4) u8, index: usize, comptime T: type) void {
-    comptime expect(@typeOf(&ptr[index]) == T);
+    comptime expect(@TypeOf(&ptr[index]) == T);
 }
 
 test "alignstack" {
@@ -303,7 +303,7 @@ test "struct field explicit alignment" {
     var node: S.Node = undefined;
     node.massive_byte = 100;
     expect(node.massive_byte == 100);
-    comptime expect(@typeOf(&node.massive_byte) == *align(64) u8);
+    comptime expect(@TypeOf(&node.massive_byte) == *align(64) u8);
     expect(@ptrToInt(&node.massive_byte) % 64 == 0);
 }
 
test/stage1/behavior/array.zig
@@ -30,7 +30,7 @@ test "void arrays" {
     var array: [4]void = undefined;
     array[0] = void{};
     array[1] = array[2];
-    expect(@sizeOf(@typeOf(array)) == 0);
+    expect(@sizeOf(@TypeOf(array)) == 0);
     expect(array.len == 4);
 }
 
@@ -109,12 +109,12 @@ test "array literal with specified size" {
 
 test "array child property" {
     var x: [5]i32 = undefined;
-    expect(@typeOf(x).Child == i32);
+    expect(@TypeOf(x).Child == i32);
 }
 
 test "array len property" {
     var x: [5]i32 = undefined;
-    expect(@typeOf(x).len == 5);
+    expect(@TypeOf(x).len == 5);
 }
 
 test "array len field" {
test/stage1/behavior/async_fn.zig
@@ -185,7 +185,7 @@ var a_promise: anyframe = undefined;
 var global_result = false;
 async fn testSuspendBlock() void {
     suspend {
-        comptime expect(@typeOf(@frame()) == *@Frame(testSuspendBlock));
+        comptime expect(@TypeOf(@frame()) == *@Frame(testSuspendBlock));
         a_promise = @frame();
     }
 
@@ -282,7 +282,7 @@ test "async fn pointer in a struct field" {
     var foo = Foo{ .bar = simpleAsyncFn2 };
     var bytes: [64]u8 align(16) = undefined;
     const f = @asyncCall(&bytes, {}, foo.bar, &data);
-    comptime expect(@typeOf(f) == anyframe->void);
+    comptime expect(@TypeOf(f) == anyframe->void);
     expect(data == 2);
     resume f;
     expect(data == 4);
@@ -332,7 +332,7 @@ test "async fn with inferred error set" {
         fn doTheTest() void {
             var frame: [1]@Frame(middle) = undefined;
             var fn_ptr = middle;
-            var result: @typeOf(fn_ptr).ReturnType.ErrorSet!void = undefined;
+            var result: @TypeOf(fn_ptr).ReturnType.ErrorSet!void = undefined;
             _ = @asyncCall(@sliceToBytes(frame[0..]), &result, fn_ptr);
             resume global_frame;
             std.testing.expectError(error.Fail, result);
@@ -952,7 +952,7 @@ test "@asyncCall with comptime-known function, but not awaited directly" {
 
         fn doTheTest() void {
             var frame: [1]@Frame(middle) = undefined;
-            var result: @typeOf(middle).ReturnType.ErrorSet!void = undefined;
+            var result: @TypeOf(middle).ReturnType.ErrorSet!void = undefined;
             _ = @asyncCall(@sliceToBytes(frame[0..]), &result, middle);
             resume global_frame;
             std.testing.expectError(error.Fail, result);
@@ -1009,7 +1009,7 @@ test "@asyncCall using the result location inside the frame" {
     var foo = Foo{ .bar = S.simple2 };
     var bytes: [64]u8 align(16) = undefined;
     const f = @asyncCall(&bytes, {}, foo.bar, &data);
-    comptime expect(@typeOf(f) == anyframe->i32);
+    comptime expect(@TypeOf(f) == anyframe->i32);
     expect(data == 2);
     resume f;
     expect(data == 4);
@@ -1017,18 +1017,18 @@ test "@asyncCall using the result location inside the frame" {
     expect(data == 1234);
 }
 
-test "@typeOf an async function call of generic fn with error union type" {
+test "@TypeOf an async function call of generic fn with error union type" {
     const S = struct {
         fn func(comptime x: var) anyerror!i32 {
-            const T = @typeOf(async func(x));
-            comptime expect(T == @typeOf(@frame()).Child);
+            const T = @TypeOf(async func(x));
+            comptime expect(T == @TypeOf(@frame()).Child);
             return undefined;
         }
     };
     _ = async S.func(i32);
 }
 
-test "using @typeOf on a generic function call" {
+test "using @TypeOf on a generic function call" {
     const S = struct {
         var global_frame: anyframe = undefined;
         var global_ok = false;
@@ -1043,7 +1043,7 @@ test "using @typeOf on a generic function call" {
             suspend {
                 global_frame = @frame();
             }
-            const F = @typeOf(async amain(x - 1));
+            const F = @TypeOf(async amain(x - 1));
             const frame = @intToPtr(*F, @ptrToInt(&buf));
             return await @asyncCall(frame, {}, amain, x - 1);
         }
@@ -1068,7 +1068,7 @@ test "recursive call of await @asyncCall with struct return type" {
             suspend {
                 global_frame = @frame();
             }
-            const F = @typeOf(async amain(x - 1));
+            const F = @TypeOf(async amain(x - 1));
             const frame = @intToPtr(*F, @ptrToInt(&buf));
             return await @asyncCall(frame, {}, amain, x - 1);
         }
@@ -1080,7 +1080,7 @@ test "recursive call of await @asyncCall with struct return type" {
         };
     };
     var res: S.Foo = undefined;
-    var frame: @typeOf(async S.amain(@as(u32, 1))) = undefined;
+    var frame: @TypeOf(async S.amain(@as(u32, 1))) = undefined;
     _ = @asyncCall(&frame, &res, S.amain, @as(u32, 1));
     resume S.global_frame;
     expect(S.global_ok);
test/stage1/behavior/atomics.zig
@@ -118,7 +118,7 @@ test "atomic load and rmw with enum" {
 
     expect(@atomicLoad(Value, &x, .SeqCst) != .b);
 
-    _ = @atomicRmw(Value, &x, .Xchg, .c, .SeqCst); 
+    _ = @atomicRmw(Value, &x, .Xchg, .c, .SeqCst);
     expect(@atomicLoad(Value, &x, .SeqCst) == .c);
     expect(@atomicLoad(Value, &x, .SeqCst) != .a);
     expect(@atomicLoad(Value, &x, .SeqCst) != .b);
@@ -143,4 +143,4 @@ fn testAtomicStore() void {
     expect(@atomicLoad(u32, &x, .SeqCst) == 1);
     @atomicStore(u32, &x, 12345678, .SeqCst);
     expect(@atomicLoad(u32, &x, .SeqCst) == 12345678);
-}
\ No newline at end of file
+}
test/stage1/behavior/cast.zig
@@ -226,14 +226,14 @@ fn testCastConstArrayRefToConstSlice() void {
     {
         const blah = "aoeu".*;
         const const_array_ref = &blah;
-        expect(@typeOf(const_array_ref) == *const [4:0]u8);
+        expect(@TypeOf(const_array_ref) == *const [4:0]u8);
         const slice: []const u8 = const_array_ref;
         expect(mem.eql(u8, slice, "aoeu"));
     }
     {
         const blah: [4]u8 = "aoeu".*;
         const const_array_ref = &blah;
-        expect(@typeOf(const_array_ref) == *const [4]u8);
+        expect(@TypeOf(const_array_ref) == *const [4]u8);
         const slice: []const u8 = const_array_ref;
         expect(mem.eql(u8, slice, "aoeu"));
     }
@@ -353,29 +353,29 @@ test "cast *[1][*]const u8 to [*]const ?[*]const u8" {
 
 test "@intCast comptime_int" {
     const result = @intCast(i32, 1234);
-    expect(@typeOf(result) == i32);
+    expect(@TypeOf(result) == i32);
     expect(result == 1234);
 }
 
 test "@floatCast comptime_int and comptime_float" {
     {
         const result = @floatCast(f16, 1234);
-        expect(@typeOf(result) == f16);
+        expect(@TypeOf(result) == f16);
         expect(result == 1234.0);
     }
     {
         const result = @floatCast(f16, 1234.0);
-        expect(@typeOf(result) == f16);
+        expect(@TypeOf(result) == f16);
         expect(result == 1234.0);
     }
     {
         const result = @floatCast(f32, 1234);
-        expect(@typeOf(result) == f32);
+        expect(@TypeOf(result) == f32);
         expect(result == 1234.0);
     }
     {
         const result = @floatCast(f32, 1234.0);
-        expect(@typeOf(result) == f32);
+        expect(@TypeOf(result) == f32);
         expect(result == 1234.0);
     }
 }
@@ -383,12 +383,12 @@ test "@floatCast comptime_int and comptime_float" {
 test "comptime_int @intToFloat" {
     {
         const result = @intToFloat(f16, 1234);
-        expect(@typeOf(result) == f16);
+        expect(@TypeOf(result) == f16);
         expect(result == 1234.0);
     }
     {
         const result = @intToFloat(f32, 1234);
-        expect(@typeOf(result) == f32);
+        expect(@TypeOf(result) == f32);
         expect(result == 1234.0);
     }
 }
@@ -396,7 +396,7 @@ test "comptime_int @intToFloat" {
 test "@bytesToSlice keeps pointer alignment" {
     var bytes = [_]u8{ 0x01, 0x02, 0x03, 0x04 };
     const numbers = @bytesToSlice(u32, bytes[0..]);
-    comptime expect(@typeOf(numbers) == []align(@alignOf(@typeOf(bytes))) u32);
+    comptime expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
 }
 
 test "@intCast i32 to u7" {
test/stage1/behavior/error.zig
@@ -83,9 +83,9 @@ test "error union type " {
 fn testErrorUnionType() void {
     const x: anyerror!i32 = 1234;
     if (x) |value| expect(value == 1234) else |_| unreachable;
-    expect(@typeId(@typeOf(x)) == builtin.TypeId.ErrorUnion);
-    expect(@typeId(@typeOf(x).ErrorSet) == builtin.TypeId.ErrorSet);
-    expect(@typeOf(x).ErrorSet == anyerror);
+    expect(@typeId(@TypeOf(x)) == builtin.TypeId.ErrorUnion);
+    expect(@typeId(@TypeOf(x).ErrorSet) == builtin.TypeId.ErrorSet);
+    expect(@TypeOf(x).ErrorSet == anyerror);
 }
 
 test "error set type" {
test/stage1/behavior/eval.zig
@@ -105,7 +105,7 @@ pub fn vec3(x: f32, y: f32, z: f32) Vec3 {
 
 test "constant expressions" {
     var array: [array_size]u8 = undefined;
-    expect(@sizeOf(@typeOf(array)) == 20);
+    expect(@sizeOf(@TypeOf(array)) == 20);
 }
 const array_size: u8 = 20;
 
@@ -598,7 +598,7 @@ test "pointer to type" {
         var T: type = i32;
         expect(T == i32);
         var ptr = &T;
-        expect(@typeOf(ptr) == *type);
+        expect(@TypeOf(ptr) == *type);
         ptr.* = f32;
         expect(T == f32);
         expect(*T == *f32);
test/stage1/behavior/fn.zig
@@ -73,7 +73,7 @@ fn fnWithUnreachable() noreturn {
 }
 
 test "function pointers" {
-    const fns = [_]@typeOf(fn1){
+    const fns = [_]@TypeOf(fn1){
         fn1,
         fn2,
         fn3,
@@ -130,7 +130,7 @@ test "pass by non-copying value through var arg" {
 }
 
 fn addPointCoordsVar(pt: var) i32 {
-    comptime expect(@typeOf(pt) == Point);
+    comptime expect(@TypeOf(pt) == Point);
     return pt.x + pt.y;
 }
 
@@ -170,7 +170,7 @@ test "pass by non-copying value as method, at comptime" {
 }
 
 fn outer(y: u32) fn (u32) u32 {
-    const Y = @typeOf(y);
+    const Y = @TypeOf(y);
     const st = struct {
         fn get(z: u32) u32 {
             return z + @sizeOf(Y);
@@ -265,7 +265,7 @@ test "ability to give comptime types and non comptime types to same parameter" {
         }
 
         fn foo(arg: var) i32 {
-            if (@typeInfo(@typeOf(arg)) == .Type and arg == i32) return 20;
+            if (@typeInfo(@TypeOf(arg)) == .Type and arg == i32) return 20;
             return 9 + arg;
         }
     };
test/stage1/behavior/for.zig
@@ -29,9 +29,9 @@ test "for loop with pointer elem var" {
     expect(mem.eql(u8, &target, "bcdefgh"));
 
     for (source) |*c, i|
-        expect(@typeOf(c) == *const u8);
+        expect(@TypeOf(c) == *const u8);
     for (target) |*c, i|
-        expect(@typeOf(c) == *u8);
+        expect(@TypeOf(c) == *u8);
 }
 
 fn mangleString(s: []u8) void {
test/stage1/behavior/generics.zig
@@ -47,7 +47,7 @@ comptime {
     expect(max_f64(1.2, 3.4) == 3.4);
 }
 
-fn max_var(a: var, b: var) @typeOf(a + b) {
+fn max_var(a: var, b: var) @TypeOf(a + b) {
     return if (a > b) a else b;
 }
 
test/stage1/behavior/math.zig
@@ -281,8 +281,8 @@ test "small int addition" {
     x += 1;
     expect(x == 3);
 
-    var result: @typeOf(x) = 3;
-    expect(@addWithOverflow(@typeOf(x), x, 1, &result));
+    var result: @TypeOf(x) = 3;
+    expect(@addWithOverflow(@TypeOf(x), x, 1, &result));
 
     expect(result == 0);
 }
@@ -586,7 +586,7 @@ test "@sqrt" {
 
     const x = 14.0;
     const y = x * x;
-    const z = @sqrt(@typeOf(y), y);
+    const z = @sqrt(@TypeOf(y), y);
     comptime expect(z == x);
 }
 
test/stage1/behavior/misc.zig
@@ -362,8 +362,8 @@ test "string concatenation" {
     const a = "OK" ++ " IT " ++ "WORKED";
     const b = "OK IT WORKED";
 
-    comptime expect(@typeOf(a) == *const [12:0]u8);
-    comptime expect(@typeOf(b) == *const [12:0]u8);
+    comptime expect(@TypeOf(a) == *const [12:0]u8);
+    comptime expect(@TypeOf(b) == *const [12:0]u8);
 
     const len = mem.len(u8, b);
     const len_with_null = len + 1;
@@ -460,19 +460,19 @@ test "@typeId" {
         expect(@typeId(*f32) == Tid.Pointer);
         expect(@typeId([2]u8) == Tid.Array);
         expect(@typeId(AStruct) == Tid.Struct);
-        expect(@typeId(@typeOf(1)) == Tid.ComptimeInt);
-        expect(@typeId(@typeOf(1.0)) == Tid.ComptimeFloat);
-        expect(@typeId(@typeOf(undefined)) == Tid.Undefined);
-        expect(@typeId(@typeOf(null)) == Tid.Null);
+        expect(@typeId(@TypeOf(1)) == Tid.ComptimeInt);
+        expect(@typeId(@TypeOf(1.0)) == Tid.ComptimeFloat);
+        expect(@typeId(@TypeOf(undefined)) == Tid.Undefined);
+        expect(@typeId(@TypeOf(null)) == Tid.Null);
         expect(@typeId(?i32) == Tid.Optional);
         expect(@typeId(anyerror!i32) == Tid.ErrorUnion);
         expect(@typeId(anyerror) == Tid.ErrorSet);
         expect(@typeId(AnEnum) == Tid.Enum);
-        expect(@typeId(@typeOf(AUnionEnum.One)) == Tid.Enum);
+        expect(@typeId(@TypeOf(AUnionEnum.One)) == Tid.Enum);
         expect(@typeId(AUnionEnum) == Tid.Union);
         expect(@typeId(AUnion) == Tid.Union);
         expect(@typeId(fn () void) == Tid.Fn);
-        expect(@typeId(@typeOf(builtin)) == Tid.Type);
+        expect(@typeId(@TypeOf(builtin)) == Tid.Type);
         // TODO bound fn
         // TODO arg tuple
         // TODO opaque
@@ -652,9 +652,9 @@ test "volatile load and store" {
 
 test "slice string literal has type []const u8" {
     comptime {
-        expect(@typeOf("aoeu"[0..]) == []const u8);
+        expect(@TypeOf("aoeu"[0..]) == []const u8);
         const array = [_]i32{ 1, 2, 3, 4 };
-        expect(@typeOf(array[0..]) == []const i32);
+        expect(@TypeOf(array[0..]) == []const i32);
     }
 }
 
test/stage1/behavior/pointers.zig
@@ -93,10 +93,10 @@ test "peer type resolution with C pointers" {
     var x2 = if (t) ptr_many else ptr_c;
     var x3 = if (t) ptr_c else ptr_one;
     var x4 = if (t) ptr_c else ptr_many;
-    expect(@typeOf(x1) == [*c]u8);
-    expect(@typeOf(x2) == [*c]u8);
-    expect(@typeOf(x3) == [*c]u8);
-    expect(@typeOf(x4) == [*c]u8);
+    expect(@TypeOf(x1) == [*c]u8);
+    expect(@TypeOf(x2) == [*c]u8);
+    expect(@TypeOf(x3) == [*c]u8);
+    expect(@TypeOf(x4) == [*c]u8);
 }
 
 test "implicit casting between C pointer and optional non-C pointer" {
@@ -144,11 +144,11 @@ test "allowzero pointer and slice" {
     expect(opt_ptr != null);
     expect(@ptrToInt(ptr) == 0);
     var slice = ptr[0..10];
-    expect(@typeOf(slice) == []allowzero i32);
+    expect(@TypeOf(slice) == []allowzero i32);
     expect(@ptrToInt(&slice[5]) == 20);
 
-    expect(@typeInfo(@typeOf(ptr)).Pointer.is_allowzero);
-    expect(@typeInfo(@typeOf(slice)).Pointer.is_allowzero);
+    expect(@typeInfo(@TypeOf(ptr)).Pointer.is_allowzero);
+    expect(@typeInfo(@TypeOf(slice)).Pointer.is_allowzero);
 }
 
 test "assign null directly to C pointer and test null equality" {
@@ -204,7 +204,7 @@ test "assign null directly to C pointer and test null equality" {
 test "null terminated pointer" {
     const S = struct {
         fn doTheTest() void {
-            var array_with_zero = [_:0]u8{'h', 'e', 'l', 'l', 'o'};
+            var array_with_zero = [_:0]u8{ 'h', 'e', 'l', 'l', 'o' };
             var zero_ptr: [*:0]const u8 = @ptrCast([*:0]const u8, &array_with_zero);
             var no_zero_ptr: [*]const u8 = zero_ptr;
             var zero_ptr_again = @ptrCast([*:0]const u8, no_zero_ptr);
@@ -218,7 +218,7 @@ test "null terminated pointer" {
 test "allow any sentinel" {
     const S = struct {
         fn doTheTest() void {
-            var array = [_:std.math.minInt(i32)]i32{1, 2, 3, 4};
+            var array = [_:std.math.minInt(i32)]i32{ 1, 2, 3, 4 };
             var ptr: [*:std.math.minInt(i32)]i32 = &array;
             expect(ptr[4] == std.math.minInt(i32));
         }
@@ -229,10 +229,14 @@ test "allow any sentinel" {
 
 test "pointer sentinel with enums" {
     const S = struct {
-        const Number = enum{one, two, sentinel};
+        const Number = enum {
+            one,
+            two,
+            sentinel,
+        };
 
         fn doTheTest() void {
-            var ptr: [*:.sentinel]Number = &[_:.sentinel]Number{.one, .two, .two, .one};
+            var ptr: [*:.sentinel]Number = &[_:.sentinel]Number{ .one, .two, .two, .one };
             expect(ptr[4] == .sentinel); // TODO this should be comptime expect, see #3731
         }
     };
@@ -243,7 +247,7 @@ test "pointer sentinel with enums" {
 test "pointer sentinel with optional element" {
     const S = struct {
         fn doTheTest() void {
-            var ptr: [*:null]?i32 = &[_:null]?i32{1, 2, 3, 4};
+            var ptr: [*:null]?i32 = &[_:null]?i32{ 1, 2, 3, 4 };
             expect(ptr[4] == null); // TODO this should be comptime expect, see #3731
         }
     };
@@ -255,7 +259,7 @@ test "pointer sentinel with +inf" {
     const S = struct {
         fn doTheTest() void {
             const inf = std.math.inf_f32;
-            var ptr: [*:inf]f32 = &[_:inf]f32{1.1, 2.2, 3.3, 4.4};
+            var ptr: [*:inf]f32 = &[_:inf]f32{ 1.1, 2.2, 3.3, 4.4 };
             expect(ptr[4] == inf); // TODO this should be comptime expect, see #3731
         }
     };
test/stage1/behavior/ptrcast.zig
@@ -55,7 +55,7 @@ test "comptime ptrcast keeps larger alignment" {
     comptime {
         const a: u32 = 1234;
         const p = @ptrCast([*]const u8, &a);
-        std.debug.assert(@typeOf(p) == [*]align(@alignOf(u32)) const u8);
+        std.debug.assert(@TypeOf(p) == [*]align(@alignOf(u32)) const u8);
     }
 }
 
test/stage1/behavior/reflection.zig
@@ -13,12 +13,12 @@ test "reflection: array, pointer, optional, error union type child" {
 
 test "reflection: function return type, var args, and param types" {
     comptime {
-        expect(@typeOf(dummy).ReturnType == i32);
-        expect(!@typeOf(dummy).is_var_args);
-        expect(@typeOf(dummy).arg_count == 3);
-        expect(@ArgType(@typeOf(dummy), 0) == bool);
-        expect(@ArgType(@typeOf(dummy), 1) == i32);
-        expect(@ArgType(@typeOf(dummy), 2) == f32);
+        expect(@TypeOf(dummy).ReturnType == i32);
+        expect(!@TypeOf(dummy).is_var_args);
+        expect(@TypeOf(dummy).arg_count == 3);
+        expect(@ArgType(@TypeOf(dummy), 0) == bool);
+        expect(@ArgType(@TypeOf(dummy), 1) == i32);
+        expect(@ArgType(@TypeOf(dummy), 2) == f32);
     }
 }
 
test/stage1/behavior/sizeof_and_typeof.zig
@@ -1,12 +1,12 @@
 const builtin = @import("builtin");
 const expect = @import("std").testing.expect;
 
-test "@sizeOf and @typeOf" {
-    const y: @typeOf(x) = 120;
-    expect(@sizeOf(@typeOf(y)) == 2);
+test "@sizeOf and @TypeOf" {
+    const y: @TypeOf(x) = 120;
+    expect(@sizeOf(@TypeOf(y)) == 2);
 }
 const x: u16 = 13;
-const z: @typeOf(x) = 19;
+const z: @TypeOf(x) = 19;
 
 const A = struct {
     a: u8,
@@ -71,8 +71,8 @@ test "@bitOffsetOf" {
 test "@sizeOf on compile-time types" {
     expect(@sizeOf(comptime_int) == 0);
     expect(@sizeOf(comptime_float) == 0);
-    expect(@sizeOf(@typeOf(.hi)) == 0);
-    expect(@sizeOf(@typeOf(type)) == 0);
+    expect(@sizeOf(@TypeOf(.hi)) == 0);
+    expect(@sizeOf(@TypeOf(type)) == 0);
 }
 
 test "@sizeOf(T) == 0 doesn't force resolving struct size" {
@@ -90,7 +90,7 @@ test "@sizeOf(T) == 0 doesn't force resolving struct size" {
     expect(@sizeOf(S.Bar) == 8);
 }
 
-test "@typeOf() has no runtime side effects" {
+test "@TypeOf() has no runtime side effects" {
     const S = struct {
         fn foo(comptime T: type, ptr: *T) T {
             ptr.* += 1;
@@ -98,12 +98,12 @@ test "@typeOf() has no runtime side effects" {
         }
     };
     var data: i32 = 0;
-    const T = @typeOf(S.foo(i32, &data));
+    const T = @TypeOf(S.foo(i32, &data));
     comptime expect(T == i32);
     expect(data == 0);
 }
 
-test "branching logic inside @typeOf" {
+test "branching logic inside @TypeOf" {
     const S = struct {
         var data: i32 = 0;
         fn foo() anyerror!i32 {
@@ -111,7 +111,7 @@ test "branching logic inside @typeOf" {
             return undefined;
         }
     };
-    const T = @typeOf(S.foo() catch undefined);
+    const T = @TypeOf(S.foo() catch undefined);
     comptime expect(T == i32);
     expect(S.data == 0);
 }
test/stage1/behavior/switch.zig
@@ -406,7 +406,7 @@ test "switch prongs with cases with identical payload types" {
         fn doTheSwitch1(u: Union) void {
             switch (u) {
                 .A, .C => |e| {
-                    expect(@typeOf(e) == usize);
+                    expect(@TypeOf(e) == usize);
                     expect(e == 8);
                 },
                 .B => |e| @panic("fail"),
@@ -416,7 +416,7 @@ test "switch prongs with cases with identical payload types" {
             switch (u) {
                 .A, .C => |e| @panic("fail"),
                 .B => |e| {
-                    expect(@typeOf(e) == isize);
+                    expect(@TypeOf(e) == isize);
                     expect(e == -8);
                 },
             }
test/stage1/behavior/type.zig
@@ -125,10 +125,10 @@ test "Type.ComptimeInt" {
     testTypes(&[_]type{comptime_int});
 }
 test "Type.Undefined" {
-    testTypes(&[_]type{@typeOf(undefined)});
+    testTypes(&[_]type{@TypeOf(undefined)});
 }
 test "Type.Null" {
-    testTypes(&[_]type{@typeOf(null)});
+    testTypes(&[_]type{@TypeOf(null)});
 }
 test "@Type create slice with null sentinel" {
     const Slice = @Type(builtin.TypeInfo{
test/stage1/behavior/type_info.zig
@@ -201,7 +201,7 @@ fn testUnion() void {
     expect(typeinfo_info.Union.fields.len == 25);
     expect(typeinfo_info.Union.fields[4].enum_field != null);
     expect(typeinfo_info.Union.fields[4].enum_field.?.value == 4);
-    expect(typeinfo_info.Union.fields[4].field_type == @typeOf(@typeInfo(u8).Int));
+    expect(typeinfo_info.Union.fields[4].field_type == @TypeOf(@typeInfo(u8).Int));
     expect(typeinfo_info.Union.decls.len == 21);
 
     const TestNoTagUnion = union {
@@ -264,7 +264,7 @@ test "type info: function type info" {
 }
 
 fn testFunction() void {
-    const fn_info = @typeInfo(@typeOf(foo));
+    const fn_info = @typeInfo(@TypeOf(foo));
     expect(@as(TypeId, fn_info) == TypeId.Fn);
     expect(fn_info.Fn.calling_convention == TypeInfo.CallingConvention.Unspecified);
     expect(fn_info.Fn.is_generic);
@@ -273,7 +273,7 @@ fn testFunction() void {
     expect(fn_info.Fn.return_type == null);
 
     const test_instance: TestStruct = undefined;
-    const bound_fn_info = @typeInfo(@typeOf(test_instance.foo));
+    const bound_fn_info = @typeInfo(@TypeOf(test_instance.foo));
     expect(@as(TypeId, bound_fn_info) == TypeId.BoundFn);
     expect(bound_fn_info.BoundFn.args[0].arg_type.? == *const TestStruct);
 }
test/stage1/behavior/undefined.zig
@@ -64,5 +64,5 @@ test "assign undefined to struct with method" {
 
 test "type name of undefined" {
     const x = undefined;
-    expect(mem.eql(u8, @typeName(@typeOf(x)), "(undefined)"));
+    expect(mem.eql(u8, @typeName(@TypeOf(x)), "(undefined)"));
 }
test/stage1/behavior/vector.zig
@@ -148,7 +148,7 @@ test "vector @splat" {
         fn doTheTest() void {
             var v: u32 = 5;
             var x = @splat(4, v);
-            expect(@typeOf(x) == @Vector(4, u32));
+            expect(@TypeOf(x) == @Vector(4, u32));
             var array_x: [4]u32 = x;
             expect(array_x[0] == 5);
             expect(array_x[1] == 5);
test/compare_output.zig
@@ -258,12 +258,12 @@ pub fn addCases(cases: *tests.CompareOutputContext) void {
     cases.add("order-independent declarations",
         \\const io = @import("std").io;
         \\const z = io.stdin_fileno;
-        \\const x : @typeOf(y) = 1234;
+        \\const x : @TypeOf(y) = 1234;
         \\const y : u16 = 5678;
         \\pub fn main() void {
         \\    var x_local : i32 = print_ok(x);
         \\}
-        \\fn print_ok(val: @typeOf(x)) @typeOf(foo) {
+        \\fn print_ok(val: @TypeOf(x)) @TypeOf(foo) {
         \\    const stdout = &io.getStdOut().outStream().stream;
         \\    stdout.print("OK\n", .{}) catch unreachable;
         \\    return 0;
test/compile_errors.zig
@@ -154,7 +154,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    };
         \\}
     , &[_][]const u8{
-        "tmp.zig:11:25: error: expected type 'u32', found '@typeOf(get_uval).ReturnType.ErrorSet!u32'",
+        "tmp.zig:11:25: error: expected type 'u32', found '@TypeOf(get_uval).ReturnType.ErrorSet!u32'",
     });
 
     cases.add("asigning to struct or union fields that are not optionals with a function that returns an optional",
@@ -854,7 +854,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     cases.add("field access of slices",
         \\export fn entry() void {
         \\    var slice: []i32 = undefined;
-        \\    const info = @typeOf(slice).unknown;
+        \\    const info = @TypeOf(slice).unknown;
         \\}
     , &[_][]const u8{
         "tmp.zig:3:32: error: type '[]i32' does not support field access",
@@ -894,7 +894,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
 
     cases.add("@sizeOf bad type",
         \\export fn entry() usize {
-        \\    return @sizeOf(@typeOf(null));
+        \\    return @sizeOf(@TypeOf(null));
         \\}
     , &[_][]const u8{
         "tmp.zig:2:20: error: no size available for type '(null)'",
@@ -1033,7 +1033,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
 
     cases.add("bogus compile var",
         \\const x = @import("builtin").bogus;
-        \\export fn entry() usize { return @sizeOf(@typeOf(x)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(x)); }
     , &[_][]const u8{
         "tmp.zig:1:29: error: container 'builtin' has no member called 'bogus'",
     });
@@ -1080,7 +1080,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\var foo: Foo = undefined;
         \\
         \\export fn entry() usize {
-        \\    return @sizeOf(@typeOf(foo.x));
+        \\    return @sizeOf(@TypeOf(foo.x));
         \\}
     , &[_][]const u8{
         "tmp.zig:1:13: error: struct 'Foo' depends on itself",
@@ -1118,8 +1118,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     });
 
     cases.add("top level decl dependency loop",
-        \\const a : @typeOf(b) = 0;
-        \\const b : @typeOf(a) = 0;
+        \\const a : @TypeOf(b) = 0;
+        \\const b : @TypeOf(a) = 0;
         \\export fn entry() void {
         \\    const c = a + b;
         \\}
@@ -1620,7 +1620,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\var x: f64 = 1.0;
         \\var y: f32 = x;
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(y)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(y)); }
     , &[_][]const u8{
         "tmp.zig:2:14: error: expected type 'f32', found 'f64'",
     });
@@ -2494,7 +2494,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    }
         \\}
     , &[_][]const u8{
-        "tmp.zig:5:14: error: duplicate switch value: '@typeOf(foo).ReturnType.ErrorSet.Foo'",
+        "tmp.zig:5:14: error: duplicate switch value: '@TypeOf(foo).ReturnType.ErrorSet.Foo'",
         "tmp.zig:3:14: note: other value is here",
     });
 
@@ -2626,7 +2626,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    try foo();
         \\}
     , &[_][]const u8{
-        "tmp.zig:5:5: error: cannot resolve inferred error set '@typeOf(foo).ReturnType.ErrorSet': function 'foo' not fully analyzed yet",
+        "tmp.zig:5:5: error: cannot resolve inferred error set '@TypeOf(foo).ReturnType.ErrorSet': function 'foo' not fully analyzed yet",
     });
 
     cases.add("implicit cast of error set not a subset",
@@ -3555,7 +3555,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    }
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:8:5: error: enumeration value 'Number.Four' not handled in switch",
     });
@@ -3577,7 +3577,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    }
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:13:15: error: duplicate switch value",
         "tmp.zig:10:15: note: other value is here",
@@ -3601,7 +3601,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    }
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:13:15: error: duplicate switch value",
         "tmp.zig:10:15: note: other value is here",
@@ -3628,7 +3628,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\        0 => {},
         \\    }
         \\}
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:2:5: error: switch must handle all possibilities",
     });
@@ -3642,7 +3642,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\        206 ... 255 => 3,
         \\    };
         \\}
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:6:9: error: duplicate switch value",
         "tmp.zig:5:14: note: previous value is here",
@@ -3655,7 +3655,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    }
         \\}
         \\const y: u8 = 100;
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:2:5: error: else prong required when switching on type '*u8'",
     });
@@ -3673,7 +3673,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\const derp: usize = 1234;
         \\const a = derp ++ "foo";
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(a)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(a)); }
     , &[_][]const u8{
         "tmp.zig:3:11: error: expected array, found 'usize'",
     });
@@ -3683,14 +3683,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return s ++ "foo";
         \\}
         \\var s: [10]u8 = undefined;
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:2:12: error: unable to evaluate constant expression",
     });
 
     cases.add("@cImport with bogus include",
         \\const c = @cImport(@cInclude("bogus.h"));
-        \\export fn entry() usize { return @sizeOf(@typeOf(c.bogo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(c.bogo)); }
     , &[_][]const u8{
         "tmp.zig:1:11: error: C import failed",
         ".h:1:10: note: 'bogus.h' file not found",
@@ -3700,14 +3700,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\const x = 3;
         \\const y = &x;
         \\fn foo() *const i32 { return y; }
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:3:30: error: expected type '*const i32', found '*const comptime_int'",
     });
 
     cases.add("integer overflow error",
         \\const x : u8 = 300;
-        \\export fn entry() usize { return @sizeOf(@typeOf(x)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(x)); }
     , &[_][]const u8{
         "tmp.zig:1:16: error: integer value 300 cannot be coerced to type 'u8'",
     });
@@ -3736,7 +3736,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    }
         \\};
         \\
-        \\const member_fn_type = @typeOf(Foo.member_a);
+        \\const member_fn_type = @TypeOf(Foo.member_a);
         \\const members = [_]member_fn_type {
         \\    Foo.member_a,
         \\    Foo.member_b,
@@ -3746,21 +3746,21 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    const result = members[index]();
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:20:34: error: expected 1 arguments, found 0",
     });
 
     cases.add("missing function name",
         \\fn () void {}
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:1:1: error: missing function name",
     });
 
     cases.add("missing param name",
         \\fn f(i32) void {}
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:1:6: error: missing parameter name",
     });
@@ -3770,7 +3770,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\fn a() i32 {return 0;}
         \\fn b() i32 {return 1;}
         \\fn c() i32 {return 2;}
-        \\export fn entry() usize { return @sizeOf(@typeOf(fns)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(fns)); }
     , &[_][]const u8{
         "tmp.zig:1:28: error: expected type 'fn() void', found 'fn() i32'",
     });
@@ -3781,7 +3781,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\pub fn b(x: i32) i32 {return x + 1;}
         \\export fn c(x: i32) i32 {return x + 2;}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(fns)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(fns)); }
     , &[_][]const u8{
         "tmp.zig:1:37: error: expected type 'fn(i32) i32', found 'extern fn(i32) i32'",
     });
@@ -3789,7 +3789,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     cases.add("colliding invalid top level functions",
         \\fn func() bogus {}
         \\fn func() bogus {}
-        \\export fn entry() usize { return @sizeOf(@typeOf(func)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(func)); }
     , &[_][]const u8{
         "tmp.zig:2:1: error: redefinition of 'func'",
     });
@@ -3801,7 +3801,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\var global_var: usize = 1;
         \\fn get() usize { return global_var; }
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(Foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(Foo)); }
     , &[_][]const u8{
         "tmp.zig:5:25: error: unable to evaluate constant expression",
         "tmp.zig:2:12: note: referenced here",
@@ -3813,7 +3813,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\};
         \\const x = Foo {.field = 1} + Foo {.field = 2};
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(x)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(x)); }
     , &[_][]const u8{
         "tmp.zig:4:28: error: invalid operands to binary expression: 'Foo' and 'Foo'",
     });
@@ -3824,10 +3824,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\const int_x = @as(u32, 1) / @as(u32, 0);
         \\const float_x = @as(f32, 1.0) / @as(f32, 0.0);
         \\
-        \\export fn entry1() usize { return @sizeOf(@typeOf(lit_int_x)); }
-        \\export fn entry2() usize { return @sizeOf(@typeOf(lit_float_x)); }
-        \\export fn entry3() usize { return @sizeOf(@typeOf(int_x)); }
-        \\export fn entry4() usize { return @sizeOf(@typeOf(float_x)); }
+        \\export fn entry1() usize { return @sizeOf(@TypeOf(lit_int_x)); }
+        \\export fn entry2() usize { return @sizeOf(@TypeOf(lit_float_x)); }
+        \\export fn entry3() usize { return @sizeOf(@TypeOf(int_x)); }
+        \\export fn entry4() usize { return @sizeOf(@TypeOf(float_x)); }
     , &[_][]const u8{
         "tmp.zig:1:21: error: division by zero",
         "tmp.zig:2:25: error: division by zero",
@@ -3839,7 +3839,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\const foo = "a
         \\b";
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:1:15: error: newline not allowed in string literal",
     });
@@ -3848,7 +3848,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\fn foo() void {}
         \\const invalid = foo > foo;
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(invalid)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(invalid)); }
     , &[_][]const u8{
         "tmp.zig:2:21: error: operator not allowed for type 'fn() void'",
     });
@@ -3859,7 +3859,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return foo(a, b);
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(test1)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(test1)); }
     , &[_][]const u8{
         "tmp.zig:3:16: error: unable to evaluate constant expression",
     });
@@ -3867,7 +3867,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     cases.add("assign null to non-optional pointer",
         \\const a: *u8 = null;
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(a)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(a)); }
     , &[_][]const u8{
         "tmp.zig:1:16: error: expected type '*u8', found '(null)'",
     });
@@ -3887,7 +3887,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return 1 / x;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(y)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(y)); }
     , &[_][]const u8{
         "tmp.zig:3:14: error: division by zero",
         "tmp.zig:1:14: note: referenced here",
@@ -3896,7 +3896,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     cases.add("branch on undefined value",
         \\const x = if (undefined) true else false;
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(x)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(x)); }
     , &[_][]const u8{
         "tmp.zig:1:15: error: use of undefined value here causes undefined behavior",
     });
@@ -4276,7 +4276,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return fibbonaci(x - 1) + fibbonaci(x - 2);
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(seventh_fib_number)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(seventh_fib_number)); }
     , &[_][]const u8{
         "tmp.zig:3:21: error: evaluation exceeded 1000 backwards branches",
         "tmp.zig:1:37: note: referenced here",
@@ -4286,7 +4286,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     cases.add("@embedFile with bogus file",
         \\const resource = @embedFile("bogus.txt",);
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(resource)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(resource)); }
     , &[_][]const u8{
         "tmp.zig:1:29: error: unable to find '",
         "bogus.txt'",
@@ -4299,7 +4299,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\const a = Foo {.x = get_it()};
         \\extern fn get_it() i32;
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(a)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(a)); }
     , &[_][]const u8{
         "tmp.zig:4:21: error: unable to evaluate constant expression",
     });
@@ -4315,7 +4315,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\}
         \\var global_side_effect = false;
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(a)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(a)); }
     , &[_][]const u8{
         "tmp.zig:6:26: error: unable to evaluate constant expression",
         "tmp.zig:4:17: note: referenced here",
@@ -4344,8 +4344,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return a.* == b.*;
         \\}
         \\
-        \\export fn entry1() usize { return @sizeOf(@typeOf(bad_eql_1)); }
-        \\export fn entry2() usize { return @sizeOf(@typeOf(bad_eql_2)); }
+        \\export fn entry1() usize { return @sizeOf(@TypeOf(bad_eql_1)); }
+        \\export fn entry2() usize { return @sizeOf(@TypeOf(bad_eql_2)); }
     , &[_][]const u8{
         "tmp.zig:2:14: error: operator not allowed for type '[]u8'",
         "tmp.zig:9:16: error: operator not allowed for type 'EnumWithData'",
@@ -4392,7 +4392,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return -x;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(y)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(y)); }
     , &[_][]const u8{
         "tmp.zig:3:12: error: negation caused overflow",
         "tmp.zig:1:14: note: referenced here",
@@ -4404,7 +4404,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return a + b;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(y)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(y)); }
     , &[_][]const u8{
         "tmp.zig:3:14: error: operation caused overflow",
         "tmp.zig:1:14: note: referenced here",
@@ -4416,7 +4416,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return a - b;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(y)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(y)); }
     , &[_][]const u8{
         "tmp.zig:3:14: error: operation caused overflow",
         "tmp.zig:1:14: note: referenced here",
@@ -4428,7 +4428,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return a * b;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(y)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(y)); }
     , &[_][]const u8{
         "tmp.zig:3:14: error: operation caused overflow",
         "tmp.zig:1:14: note: referenced here",
@@ -4440,7 +4440,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return @truncate(i8, x);
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:3:26: error: expected signed integer type, found 'u32'",
     });
@@ -4480,7 +4480,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\fn f() i32 {
         \\    return foo(1, 2);
         \\}
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:1:15: error: comptime parameter not allowed in function with calling convention 'ccc'",
     });
@@ -4524,7 +4524,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\fn f(m: []const u8) void {
         \\    m.copy(u8, self[0..], m);
         \\}
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:3:6: error: no member named 'copy' in '[]const u8'",
     });
@@ -4537,7 +4537,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\
         \\    foo.method(1, 2);
         \\}
-        \\export fn entry() usize { return @sizeOf(@typeOf(f)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(f)); }
     , &[_][]const u8{
         "tmp.zig:6:15: error: expected 2 arguments, found 3",
     });
@@ -4596,7 +4596,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    var jd = JsonNode {.kind = JsonType.JSONArray , .jobject = JsonOA.JSONArray {jll} };
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:5:16: error: use of undeclared identifier 'JsonList'",
     });
@@ -4655,7 +4655,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\const TINY_QUANTUM_SIZE = 1 << TINY_QUANTUM_SHIFT;
         \\var block_aligned_stuff: usize = (4 + TINY_QUANTUM_SIZE) & ~(TINY_QUANTUM_SIZE - 1);
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(block_aligned_stuff)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(block_aligned_stuff)); }
     , &[_][]const u8{
         "tmp.zig:3:60: error: unable to perform binary not operation on type 'comptime_int'",
     });
@@ -4683,7 +4683,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\const zero: i32 = 0;
         \\const a = zero{1};
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(a)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(a)); }
     , &[_][]const u8{
         "tmp.zig:2:11: error: expected type 'type', found 'i32'",
     });
@@ -4715,7 +4715,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return 0;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(testTrickyDefer)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(testTrickyDefer)); }
     , &[_][]const u8{
         "tmp.zig:4:11: error: cannot return from defer expression",
     });
@@ -4730,7 +4730,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
 
     cases.add("global variable alignment non power of 2",
         \\const some_data: [100]u8 align(3) = undefined;
-        \\export fn entry() usize { return @sizeOf(@typeOf(some_data)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(some_data)); }
     , &[_][]const u8{
         "tmp.zig:1:32: error: alignment value 3 is not a power of 2",
     });
@@ -4772,7 +4772,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return x.*;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:8:26: error: expected type '*const u3', found '*align(:3:1) const u3'",
     });
@@ -4875,7 +4875,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return out.*[0..1];
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(pass)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(pass)); }
     , &[_][]const u8{
         "tmp.zig:4:10: error: attempt to dereference non-pointer type '[10]u8'",
     });
@@ -4890,7 +4890,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
         \\    return true;
         \\}
         \\
-        \\export fn entry() usize { return @sizeOf(@typeOf(foo)); }
+        \\export fn entry() usize { return @sizeOf(@TypeOf(foo)); }
     , &[_][]const u8{
         "tmp.zig:4:19: error: expected type '*[]const u8', found '*const []const u8'",
     });
@@ -5726,7 +5726,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
 
     cases.add("@ArgType arg index out of bounds",
         \\comptime {
-        \\    _ = @ArgType(@typeOf(add), 2);
+        \\    _ = @ArgType(@TypeOf(add), 2);
         \\}
         \\fn add(a: i32, b: i32) i32 { return a + b; }
     , &[_][]const u8{
@@ -6220,7 +6220,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     cases.add("getting return type of generic function",
         \\fn generic(a: var) void {}
         \\comptime {
-        \\    _ = @typeOf(generic).ReturnType;
+        \\    _ = @TypeOf(generic).ReturnType;
         \\}
     , &[_][]const u8{
         "tmp.zig:3:25: error: ReturnType has not been resolved because 'fn(var)var' is generic",
@@ -6229,7 +6229,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
     cases.add("getting @ArgType of generic function",
         \\fn generic(a: var) void {}
         \\comptime {
-        \\    _ = @ArgType(@typeOf(generic), 0);
+        \\    _ = @ArgType(@TypeOf(generic), 0);
         \\}
     , &[_][]const u8{
         "tmp.zig:3:36: error: @ArgType could not resolve the type of arg 0 because 'fn(var)var' is generic",
test/translate_c.zig
@@ -1539,7 +1539,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
     cases.add("macro pointer cast",
         \\#define NRF_GPIO ((NRF_GPIO_Type *) NRF_GPIO_BASE)
     , &[_][]const u8{
-        \\pub const NRF_GPIO = if (@typeId(@typeOf(NRF_GPIO_BASE)) == @import("builtin").TypeId.Pointer) @ptrCast([*c]NRF_GPIO_Type, NRF_GPIO_BASE) else if (@typeId(@typeOf(NRF_GPIO_BASE)) == @import("builtin").TypeId.Int) @intToPtr([*c]NRF_GPIO_Type, NRF_GPIO_BASE) else @as([*c]NRF_GPIO_Type, NRF_GPIO_BASE);
+        \\pub const NRF_GPIO = if (@typeId(@TypeOf(NRF_GPIO_BASE)) == @import("builtin").TypeId.Pointer) @ptrCast([*c]NRF_GPIO_Type, NRF_GPIO_BASE) else if (@typeId(@TypeOf(NRF_GPIO_BASE)) == @import("builtin").TypeId.Int) @intToPtr([*c]NRF_GPIO_Type, NRF_GPIO_BASE) else @as([*c]NRF_GPIO_Type, NRF_GPIO_BASE);
     });
 
     cases.add("if on non-bool",
tools/merge_anal_dumps.zig
@@ -311,7 +311,7 @@ const Dump = struct {
     }
 
     fn render(self: *Dump, stream: var) !void {
-        var jw = json.WriteStream(@typeOf(stream).Child, 10).init(stream);
+        var jw = json.WriteStream(@TypeOf(stream).Child, 10).init(stream);
         try jw.beginObject();
 
         try jw.objectField("typeKinds");