From d20d844d23198f9659a9c5f1bce67df08b8a39f1 Mon Sep 17 00:00:00 2001 From: Mahdi Aghtaee <44207275+mahdiaghtaee@users.noreply.github.com> Date: Tue, 30 Jun 2026 04:19:11 +0330 Subject: [PATCH] Document sizeof behavior for enum types --- docs/csharp/language-reference/operators/sizeof.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/csharp/language-reference/operators/sizeof.md b/docs/csharp/language-reference/operators/sizeof.md index 159618d9bb89e..9a645f86f0924 100644 --- a/docs/csharp/language-reference/operators/sizeof.md +++ b/docs/csharp/language-reference/operators/sizeof.md @@ -34,6 +34,8 @@ The expressions presented in the following table are evaluated at compile time t The size of the types in the preceding table is a compile-time constant. +For an enum type, the result of the `sizeof` operator is the size of the enum's underlying integral type. The result is computed at compile time. + In [unsafe](../keywords/unsafe.md) code, you can use `sizeof` on any non-`void` type, including types constructed from type parameters. > [!NOTE]