-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Top-level members
- Specification: Add top-level members proposal #9719
- Discussion: Top-level members #9802
Summary
Allow some members (methods, operators, extension blocks, and fields) to be declared in namespaces
and make them available when the corresponding namespace is imported.
// util.cs
namespace MyApp;
void Print(string s) => Console.WriteLine(s);
string Capitalize(this string input) =>
input.Length == 0 ? input : char.ToUpper(input[0]) + input[1..];