-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Implemented Needs ECMA SpecThis feature has been implemented in C#, but still needs to be merged into the ECMA specificationThis feature has been implemented in C#, but still needs to be merged into the ECMA specificationProposal champion
Milestone
Description
Ignored Directives Support
- Specification: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-14.0/ignored-directives.md
- Discussion: [Proposal] Ignored Directives Support #8616
Summary
As we move to allow C# statements in the top level of a file, it's reasonable to assume that we might someday get support for dotnet runing a .cs file. For further use of C# as a scripting language in this vein, I propose that we introduce a new preprocessor directive who's purpose is to exist solely to be ignored by the language: the hashbang directive. Linux and Unix scripts will often use #! in order to direct the program loader to the interpreter that can run them. We should add a similar ignore to the C# language.
Design meetings
- https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-05-12.md#simple-c-programs
- https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-08-31.md#ignored-directives-support
- https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-09-26.md#ungrouped
- https://github.com/dotnet/csharplang/blob/main/meetings/2025/LDM-2025-03-12.md#ignored-directives
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Implemented Needs ECMA SpecThis feature has been implemented in C#, but still needs to be merged into the ECMA specificationThis feature has been implemented in C#, but still needs to be merged into the ECMA specificationProposal champion