# About #32099: remove \`@TypeOf\` and \`anytype\`; introduce \`|T|\` syntax

**URL:** <https://ziggit.dev/t/about-32099-remove-typeof-and-anytype-introduce-t-syntax/15707>\
**Category:** Brainstorming\
**Tags:** language\
**Created:** [May 25, 2026, 5:59am UTC](https://ziggit.dev/t/about-32099-remove-typeof-and-anytype-introduce-t-syntax/15707 "2026-05-25T05:59:08Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Verafahn](https://ziggit.dev/user_avatar/ziggit.dev/verafahn/32/9285_2.png) [@Verafahn](https://ziggit.dev/u/Verafahn)\
**Post date:** [May 25, 2026, 10:10am UTC](https://ziggit.dev/t/about-32099-remove-typeof-and-anytype-introduce-t-syntax/15707/6 "2026-05-25T10:10:46Z")

</div>

> [@gwenzek](#):
>
> I don’t see the relationship between your proposal and dynamic dispatch

Previously, I came up with a programming pattern that combines static and dynamic dispatch in Zig. You can see it below.

> [@On Static Dispatch vs Dynamic Dispatch](https://ziggit.dev/t/on-static-dispatch-vs-dynamic-dispatch/15662/6):
>
> I have found an interface design pattern where static dispatch can coexist with dynamic dispatch. I can define a trait: pub const Trait = struct { pub fn method(self: \*Trait) void { \_ = self; @compileError(""); } }; Trait is usually used to describe the contract of a static dispatch interface. I can use some tools to check whether a certain type implements a certain trait. I also can define an interface: pub const Interface = struct { vptr: \*anyopaque, vtable…

Here is a simple interface example.

```zig
// A simple interface example
pub const Trait = struct {...}; // static
pub const Interface = struct{ // dynamic
    vptr: *anyopaque,
    vtable: struct{...},
};
pub fn Warpper(comptime Impl: type) type { // unified abstract
    ...
    return struct{
        ...
    };
}

```

For the use of interfaces, accept parameters through `anytype`:

```zig
pub fn callInterface(warpper_impl: anytype) void {...}

```

If it is possible to deconstruct generic functions, the parameters can be replaced with more descriptive `Warpper(|Impl|)`:

```zig
pub fn callInterface(warpper: Warpper(|Impl|)) void {...}

```

In this mode, `Warpper(Interface)` serves as a dynamic dispatch interface, while other interfaces implemented directly through generic parameter passing can serve as static dispatch interfaces.

---

_[View the full topic](https://ziggit.dev/t/about-32099-remove-typeof-and-anytype-introduce-t-syntax/15707)._
