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
ClassesFull support including nested classes
StructsFull support
InterfacesFull support
EnumsFull support including flags
DelegatesFull support

Members

FeatureStatusNotes
FieldsPublic, private, protected, internal
PropertiesGet/set accessors
MethodsInstance and static methods
ConstructorsInstance and static constructors
Destructors/FinalizersFull support
EventsFull support
IndexersFull support
OperatorsOperator overloading

Statements

FeatureStatusNotes
if/elseFull support
switch/caseTraditional switch statements
forFull support
foreachFull support
whileFull support
do-whileFull support
breakFull support
continueFull support
returnFull support
throwFull support
try/catch/finallyFull exception handling
using statementResource management
lockThread synchronization
gotoIncluding goto case
checked/uncheckedOverflow checking

Expressions

FeatureStatusNotes
LiteralsAll literal types
Arithmetic operators+, -, *, /, %
Comparison operators==, !=, <, >, <=, >=
Logical operators&&, `
Bitwise operators&, `
Assignment operators=, +=, -=, etc.
Conditional operator? : ternary
Member access. operator
Indexing[] operator
Method invocationFull support
Object creationnew expressions
Array creationSingle and multi-dimensional
Type casting(Type)expr
typeofType information
sizeofSize of types
is operatorType testing
as operatorSafe casting

Types

FeatureStatusNotes
Primitive typesAll built-in types
ArraysSingle, multi-dimensional, jagged
Nullable value typesT? syntax
Reference typesClasses, interfaces, delegates
Value typesStructs, enums

Modifiers

FeatureStatusNotes
Access modifierspublic, private, protected, internal
staticFull support
readonlyFull support
constFull support
virtualFull support
overrideFull support
abstractFull support
sealedFull support
externFull support

C# 2.0 Features (2005)

FeatureStatusNotes
GenericsFull support including constraints
Generic constraintswhere T : class, struct, new(), etc.
Partial typespartial keyword
Anonymous methodsdelegate { } syntax
Nullable typesNullable<T> and T?
Iteratorsyield return, yield break
Covariance/Contravariancein/out variance
Static classesFull support
Property accessorsDifferent accessibility
Namespace aliasesusing Alias = Namespace
?? operatorNull-coalescing

C# 3.0 Features (2007)

FeatureStatusNotes
Auto-implemented properties{ get; set; }
Object initializersnew T { Prop = value }
Collection initializersnew List<T> { 1, 2, 3 }
Anonymous typesnew { Name = "x" }
Extension methodsthis parameter
Lambda expressionsx => x * 2
Expression treesParsing support
LINQ query syntaxfrom x in y select z
Implicitly typed variablesvar keyword
Partial methodsIn partial classes

C# 4.0 Features (2010)

FeatureStatusNotes
Dynamic bindingdynamic type
Named argumentsMethod(param: value)
Optional parametersDefault parameter values
Generic covariance/contravarianceEnhanced support
Embedded interop typesno-pia

C# 5.0 Features (2012)

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

C# 6.0 Features (2015)

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

C# 7.0 Features (2017)

FeatureStatusNotes
Out variablesMethod(out var x)
Tuples(int, string) syntax
Tuple deconstruction(var x, var y) = tuple
Pattern matchingis patterns
Local functionsFunctions inside methods
Ref returns and localsref keyword
Discards_ placeholder
Binary literals0b1010
Digit separators1_000_000
Throw expressionsx ?? throw new E()
Expression-bodied constructors=> expr syntax
Expression-bodied finalizers=> expr syntax
Expression-bodied accessorsget => expr

C# 7.1 Features (2017)

FeatureStatusNotes
Async mainasync Task Main()
Default literal expressionsdefault without type
Inferred tuple namesAutomatic naming
Pattern matching on genericsFull support

C# 7.2 Features (2017)

FeatureStatusNotes
ref readonlyRead-only references
in parametersPass by readonly reference
ref structStack-only structs
Non-trailing named argumentsMixed named/positional
private protectedAccess modifier
Leading underscores in numeric literals_123
Conditional ref expressionsref in ternary

C# 7.3 Features (2018)

FeatureStatusNotes
Tuple equality== and !=
Attributes on backing fields[field: Attribute]
Expression variables in initializersFull support
ref local reassignmentReassign ref locals
Stackalloc initializersstackalloc[] { 1, 2 }
Pattern-based fixedCustom fixed
Improved overload candidatesBetter resolution

C# 8.0 Features (2019)

FeatureStatusNotes
Nullable reference typesstring? annotations
Default interface methodsInterface implementations
Pattern matching enhancementsSwitch expressions, property patterns
Switch expressionsx switch { ... }
Property patterns{ Prop: value }
Tuple patterns(1, 2) patterns
Positional patternsDeconstruction patterns
Using declarationsusing var x = ...
Static local functionsstatic modifier
Disposable ref structsIDisposable on ref struct
Nullable reference types#nullable directives
Asynchronous streamsIAsyncEnumerable<T>
Asynchronous disposableIAsyncDisposable
Indices and ranges^ and .. operators
Null-coalescing assignment??= operator
Unmanaged constructed typesGeneric constraints
Stackalloc in nested expressionsFull support

C# 9.0 Features (2020)

FeatureStatusNotes
Recordsrecord keyword
Init-only settersinit accessor
Top-level statementsNo Main method required
Pattern matching improvementsRelational, logical patterns
Relational patterns> 0, <= 10
Logical patternsand, or, not
Target-typed newnew() without type
Covariant returnsOverride with derived type
Extension GetEnumeratorforeach support
Lambda discard parameters(_, _) => expr
Attributes on local functionsFull support
Module initializers[ModuleInitializer]
Partial methods with returnExtended partial
Native integersnint, nuint
Function pointersdelegate* syntax
Suppress emitting localsinit[SkipLocalsInit]
Target-typed conditional? : inference

C# 10.0 Features (2021)

FeatureStatusNotes
Record structsrecord struct
Global using directivesglobal using
File-scoped namespacesnamespace X;
Extended property patternsNested patterns
Constant interpolated stringsconst strings
Lambda improvementsNatural types, attributes
Caller expression attribute[CallerArgumentExpression]
Improved definite assignmentBetter analysis
Allow AsyncMethodBuilderCustom builders
Record types with sealed ToStringSealed override
Assignment and declaration in same deconstructionMixed syntax
Allow both assignment and declarationFull support

C# 11.0 Features (2022)

FeatureStatusNotes
Raw string literals"""text"""
Generic attributes[Attr<T>]
UTF-8 string literals"text"u8
Newlines in string interpolationsMulti-line expressions
List patterns[1, 2, .., 10]
File-local typesfile class
Required membersrequired modifier
Auto-default structsDefault initialization
Pattern match Span<char>Constant patterns
Extended nameof scopeMore contexts
Numeric IntPtrOperators on IntPtr
ref fieldsIn ref structs
scoped refLifetime annotations
Checked operatorsUser-defined checked

C# 12.0 Features (2023)

FeatureStatusNotes
Primary constructorsFull support for classes and structs
Collection expressions[1, 2, 3] and spread .. syntax
Inline arraysNot yet implemented
Optional parameters in lambdasFull support
ref readonly parametersFull support
Alias any typeusing Alias = (int, string)
Experimental attribute[Experimental]
InterceptorsNot 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 / #endifConditional compilation
#define / #undefSymbol definition
#warning / #errorCompiler messages
#lineLine number control
#region / #endregionCode folding
#pragma warningWarning control
#pragma checksumDebugging support
#nullableNullable 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
PointersT* syntax
unsafe keywordBlocks and methods
fixed statementPin managed objects
stackallocStack allocation
Function pointersdelegate* (C# 9+)
sizeof operatorType sizes
Pointer arithmeticFull 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