dotnet / dotnet/csharplang

[Proposal]: Unsigned `sizeof`

Open
#9,633 0 comments 14 reactions 1 assignee Claimed by @jnm2 View on GitHub
Proposal champion
Dominant language
C#
Stars
12.7k
Forks
1.1k
Avg merge
11h 1m
Merged PRs (30d)
3

Description

# Unsigned `sizeof`

- Specification: https://github.com/dotnet/csharplang/pull/9634/files [TEMPORARY URL]
- Discussion:

## Summary

This proposal enables `sizeof` expressions without a constant value to implicitly convert to unsigned integer types the same size as `uint` or larger:

```cs
uint size = sizeof(SomeStruct);
```

## Design meetings

- https://github.com/dotnet/csharplang/blob/main/meetings/2026/LDM-2026-01-12.md#unsigned-sizeof

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.