Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

C# Feature Completeness Matrix

This document tracks the implementation status of C# language features in the BSharp parser.

Legend:

  • ✅ Fully Supported - Feature is completely implemented and tested
  • 🟡 Partial Support - Feature is partially implemented or has known limitations
  • ⚠️ Planned - Feature is planned but not yet implemented
  • ❌ Not Supported - Feature is not currently supported

C# 1.0 Features (2002)

Type Declarations

FeatureStatusNotes
Classes✅Full support including nested classes
Structs✅Full support
Interfaces✅Full support
Enums✅Full support including flags
Delegates✅Full support

Members

FeatureStatusNotes
Fields✅Public, private, protected, internal
Properties✅Get/set accessors
Methods✅Instance and static methods
Constructors✅Instance and static constructors
Destructors/Finalizers✅Full support
Events✅Full support
Indexers✅Full support
Operators✅Operator overloading

Statements

FeatureStatusNotes
if/else✅Full support
switch/case✅Traditional switch statements
for✅Full support
foreach✅Full support
while✅Full support
do-while✅Full support
break✅Full support
continue✅Full support
return✅Full support
throw✅Full support
try/catch/finally✅Full exception handling
using statement✅Resource management
lock✅Thread synchronization
goto✅Including goto case
checked/unchecked✅Overflow checking

Expressions

FeatureStatusNotes
Literals✅All literal types
Arithmetic operators✅+, -, *, /, %
Comparison operators✅==, !=, <, >, <=, >=
Logical operators✅&&, `
Bitwise operators✅&, `
Assignment operators✅=, +=, -=, etc.
Conditional operator✅? : ternary
Member access✅. operator
Indexing✅[] operator
Method invocation✅Full support
Object creation✅new expressions
Array creation✅Single and multi-dimensional
Type casting✅(Type)expr
typeof✅Type information
sizeof✅Size of types
is operator✅Type testing
as operator✅Safe casting

Types

FeatureStatusNotes
Primitive types✅All built-in types
Arrays✅Single, multi-dimensional, jagged
Nullable value types✅T? syntax
Reference types✅Classes, interfaces, delegates
Value types✅Structs, enums

Modifiers

FeatureStatusNotes
Access modifiers✅public, private, protected, internal
static✅Full support
readonly✅Full support
const✅Full support
virtual✅Full support
override✅Full support
abstract✅Full support
sealed✅Full support
extern✅Full support

C# 2.0 Features (2005)

FeatureStatusNotes
Generics✅Full support including constraints
Generic constraints✅where T : class, struct, new(), etc.
Partial types✅partial keyword
Anonymous methods✅delegate { } syntax
Nullable types✅Nullable<T> and T?
Iterators✅yield return, yield break
Covariance/Contravariance✅in/out variance
Static classes✅Full support
Property accessors✅Different accessibility
Namespace aliases✅using Alias = Namespace
?? operator✅Null-coalescing

C# 3.0 Features (2007)

FeatureStatusNotes
Auto-implemented properties✅{ get; set; }
Object initializers✅new T { Prop = value }
Collection initializers✅new List<T> { 1, 2, 3 }
Anonymous types✅new { Name = "x" }
Extension methods✅this parameter
Lambda expressions✅x => x * 2
Expression trees✅Parsing support
LINQ query syntax✅from x in y select z
Implicitly typed variables✅var keyword
Partial methods✅In partial classes

C# 4.0 Features (2010)

FeatureStatusNotes
Dynamic binding✅dynamic type
Named arguments✅Method(param: value)
Optional parameters✅Default parameter values
Generic covariance/contravariance✅Enhanced support
Embedded interop types✅no-pia

C# 5.0 Features (2012)

FeatureStatusNotes
Async/await✅async and await keywords
Caller info attributes✅[CallerMemberName], etc.

C# 6.0 Features (2015)

FeatureStatusNotes
Auto-property initializers✅public int X { get; set; } = 1;
Expression-bodied members✅=> expr for methods/properties
using static✅Import static members
Null-conditional operator✅?. and ?[]
String interpolation✅$"Hello {name}"
nameof operator✅nameof(variable)
Index initializers✅[index] = value
Exception filters✅catch (E) when (condition)
await in catch/finally✅Full support

C# 7.0 Features (2017)

FeatureStatusNotes
Out variables✅Method(out var x)
Tuples✅(int, string) syntax
Tuple deconstruction✅(var x, var y) = tuple
Pattern matching✅is patterns
Local functions✅Functions inside methods
Ref returns and locals✅ref keyword
Discards✅_ placeholder
Binary literals✅0b1010
Digit separators✅1_000_000
Throw expressions✅x ?? throw new E()
Expression-bodied constructors✅=> expr syntax
Expression-bodied finalizers✅=> expr syntax
Expression-bodied accessors✅get => expr

C# 7.1 Features (2017)

FeatureStatusNotes
Async main✅async Task Main()
Default literal expressions✅default without type
Inferred tuple names✅Automatic naming
Pattern matching on generics✅Full support

C# 7.2 Features (2017)

FeatureStatusNotes
ref readonly✅Read-only references
in parameters✅Pass by readonly reference
ref struct✅Stack-only structs
Non-trailing named arguments✅Mixed named/positional
private protected✅Access modifier
Leading underscores in numeric literals✅_123
Conditional ref expressions✅ref in ternary

C# 7.3 Features (2018)

FeatureStatusNotes
Tuple equality✅== and !=
Attributes on backing fields✅[field: Attribute]
Expression variables in initializers✅Full support
ref local reassignment✅Reassign ref locals
Stackalloc initializers✅stackalloc[] { 1, 2 }
Pattern-based fixed✅Custom fixed
Improved overload candidates✅Better resolution

C# 8.0 Features (2019)

FeatureStatusNotes
Nullable reference types✅string? annotations
Default interface methods✅Interface implementations
Pattern matching enhancements✅Switch expressions, property patterns
Switch expressions✅x switch { ... }
Property patterns✅{ Prop: value }
Tuple patterns✅(1, 2) patterns
Positional patterns✅Deconstruction patterns
Using declarations✅using var x = ...
Static local functions✅static modifier
Disposable ref structs✅IDisposable on ref struct
Nullable reference types✅#nullable directives
Asynchronous streams✅IAsyncEnumerable<T>
Asynchronous disposable✅IAsyncDisposable
Indices and ranges✅^ and .. operators
Null-coalescing assignment✅??= operator
Unmanaged constructed types✅Generic constraints
Stackalloc in nested expressions✅Full support

C# 9.0 Features (2020)

FeatureStatusNotes
Records✅record keyword
Init-only setters✅init accessor
Top-level statements✅No Main method required
Pattern matching improvements✅Relational, logical patterns
Relational patterns✅> 0, <= 10
Logical patterns✅and, or, not
Target-typed new✅new() without type
Covariant returns✅Override with derived type
Extension GetEnumerator✅foreach support
Lambda discard parameters✅(_, _) => expr
Attributes on local functions✅Full support
Module initializers✅[ModuleInitializer]
Partial methods with return✅Extended partial
Native integers✅nint, nuint
Function pointers✅delegate* syntax
Suppress emitting localsinit✅[SkipLocalsInit]
Target-typed conditional✅? : inference

C# 10.0 Features (2021)

FeatureStatusNotes
Record structs✅record struct
Global using directives✅global using
File-scoped namespaces✅namespace X;
Extended property patterns✅Nested patterns
Constant interpolated strings✅const strings
Lambda improvements✅Natural types, attributes
Caller expression attribute✅[CallerArgumentExpression]
Improved definite assignment✅Better analysis
Allow AsyncMethodBuilder✅Custom builders
Record types with sealed ToString✅Sealed override
Assignment and declaration in same deconstruction✅Mixed syntax
Allow both assignment and declaration✅Full support

C# 11.0 Features (2022)

FeatureStatusNotes
Raw string literals✅"""text"""
Generic attributes✅[Attr<T>]
UTF-8 string literals✅"text"u8
Newlines in string interpolations✅Multi-line expressions
List patterns✅[1, 2, .., 10]
File-local types✅file class
Required members✅required modifier
Auto-default structs✅Default initialization
Pattern match Span<char>✅Constant patterns
Extended nameof scope✅More contexts
Numeric IntPtr✅Operators on IntPtr
ref fields✅In ref structs
scoped ref✅Lifetime annotations
Checked operators✅User-defined checked

C# 12.0 Features (2023)

FeatureStatusNotes
Primary constructors✅Full support for classes and structs
Collection expressions✅[1, 2, 3] and spread .. syntax
Inline arrays❌Not yet implemented
Optional parameters in lambdas✅Full support
ref readonly parameters✅Full support
Alias any type✅using Alias = (int, string)
Experimental attribute✅[Experimental]
Interceptors❌Not yet implemented

C# 13.0 Features (2024)

FeatureStatusNotes
params collections⚠️Planned
New lock type⚠️Planned
New escape sequence \e⚠️Planned
Method group natural type⚠️Planned
Implicit indexer access⚠️Planned
ref and unsafe in iterators⚠️Planned
ref struct interfaces⚠️Planned
Allows ref struct types⚠️Planned

C# 14.0 Features (2025 - .NET 10)

FeatureStatusNotes
Extension members🟡Parser + emitter for extension blocks; semantics planned
field keyword⚠️Planned - Field-backed properties
Null-conditional assignment⚠️Planned - ?. on left side of =
nameof unbound generics⚠️Planned - nameof(List<>)
Implicit Span<T> conversions⚠️Planned - First-class span support
Lambda parameter modifiers⚠️Planned - (out x) => ... without types
Partial constructors⚠️Planned - partial instance constructors
Partial events⚠️Planned - partial events
User-defined compound assignment⚠️Planned - Custom +=, -= operators

Preprocessor Directives

FeatureStatusNotes
#if / #elif / #else / #endif✅Conditional compilation
#define / #undef✅Symbol definition
#warning / #error✅Compiler messages
#line✅Line number control
#region / #endregion✅Code folding
#pragma warning✅Warning control
#pragma checksum✅Debugging support
#nullable✅Nullable context

Documentation Comments

FeatureStatusNotes
XML documentation✅/// and /** */
<summary>✅Full support
<param>✅Full support
<returns>✅Full support
<exception>✅Full support
<see> / <seealso>✅Full support
<example>✅Full support
<code> / <c>✅Full support
<para>✅Full support
<list>✅Full support
<include>✅Full support

Unsafe Code

FeatureStatusNotes
Pointers✅T* syntax
unsafe keyword✅Blocks and methods
fixed statement✅Pin managed objects
stackalloc✅Stack allocation
Function pointers✅delegate* (C# 9+)
sizeof operator✅Type sizes
Pointer arithmetic✅Full support
Address-of operator✅& operator
Indirection operator✅* operator

Summary Statistics

Overall Completeness

VersionFeaturesSupportedPartialPlannedNot SupportedCompletion
C# 1.080+80+000100%
C# 2.01111000100%
C# 3.01010000100%
C# 4.055000100%
C# 5.022000100%
C# 6.01010000100%
C# 7.01313000100%
C# 7.144000100%
C# 7.277000100%
C# 7.377000100%
C# 8.01818000100%
C# 9.01717000100%
C# 10.01212000100%
C# 11.01313000100%
C# 12.076001~86%
C# 13.0800800% (Preview)
C# 14.0900900% (Preview)

Total: ~99% of released C# features supported (C# 1.0 - 12.0)


Testing Coverage

Test Organization

All parser tests are located in tests/parser/ with comprehensive coverage:

  • Expression tests: tests/parser/expressions/
  • Statement tests: tests/parser/statements/
  • Declaration tests: tests/parser/declarations/
  • Type tests: tests/parser/types/
  • Pattern matching tests: tests/parser/expressions/pattern_matching_tests.rs
  • Preprocessor tests: tests/parser/preprocessor/

Test Fixtures

Real-world C# projects in tests/fixtures/:

  • happy_path/: Valid, well-formed C# code
  • complex/: Complex real-world scenarios

Known Limitations

C# 12.0 Limitations

  1. Inline Arrays: Not yet implemented

    • Requires [InlineArray(n)] attribute support
    • Planned for future release
  2. Interceptors: Not yet implemented

    • Experimental feature in C# 12
    • May be implemented when feature stabilizes

C# 13.0 & 14.0 Status

All C# 13.0 and 14.0 features are in preview/development status and planned for future implementation as they stabilize in the official .NET releases.


Contributing

To add support for new C# features:

  1. Update AST nodes in src/syntax/nodes/
  2. Implement parser in src/parser/
  3. Add comprehensive tests in tests/parser/
  4. Update this matrix to reflect new support
  5. Document in relevant parser documentation

See Contributing Guide for details.


References

  • C# Language Specification: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/
  • C# Version History: https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/
  • Roslyn Source: https://github.com/dotnet/roslyn
  • Parser Implementation: src/parser/
  • Test Suite: tests/parser/

Last Updated: 2025-09-30
Parser Version: Current development version
Maintained By: BSharp Project Contributors

2025-11-17 15:18:26 • commit: 03a4e25