Skip to main content
Version: 0.4

Feature matrix

This matrix summarizes current feature support in the emitter, which every driver uses. The historical evaluator column is retained to explain older tests; that backend and its command-line selection have been removed. Legend: Supported means implemented on that path; Mostly supported means ordinary cases work with known edge limitations; Partial means syntax or binding exists but execution or emit is incomplete; Not supported means rejected or intentionally absent; N/A means the feature belongs to tooling rather than one execution path.

Lexical and source structure

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
Lexing, parsing, keywords, tokens, literalsSupportedSupportedShared lexer and parser.
Packages, imports, import aliasesSupportedSupportedEmit supports multi-package assemblies; both backends shared the same binder.
Implicit System importSupportedSupportedEnabled by default; disabled with /noimplicitimports or /no-implicit-imports.
Top-level statements and func MainSupportedSupportedMixing top-level statements and explicit Main is diagnosed by GS0165/GS0166.
CommentsSupportedSupportedLine (//), block (/* … */), and Markdown documentation (///) comments.
String, raw string, and interpolated string literalsSupportedSupportedSigil-free interpolation with $name/${expr,alignment:format}, delimiter-aware multiline holes, and DefaultInterpolatedStringHandler/FormattableString lowering.
Character literalsSupportedSupportedCharacter diagnostics are GS0191 through GS0195.
Documentation commentsSupportedSupported/// Markdown comments round-trip to CLR XML doc; hover renders CLR XML docs for imported APIs. Diagnostics GS0227GS0231.

Types and values

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
Primitive types and numeric operatorsSupportedMostly supportedThe evaluator implemented primitive arithmetic; address/deref unary operators were limited.
Width-bearing integer namesSupportedSupportedCanonical names are int32, uint64, and related widths. Friendly aliases are also accepted: int, uint, long, ulong, short, ushort, byte, sbyte, float, and double; they resolve to the canonical TypeSymbol at the binder, so diagnostics, typeof, hover, and IL print the canonical name.
Numeric conversionsSupportedSupportedWidening numeric conversions plus explicit conversions.
object universal upper boundSupportedSupportedBoxing and object equality are implemented.
Nullable T?, nil, !!, ??, ?., ?[i]SupportedSupportedThe evaluator threw on a nil !!; ?[i] short-circuited indexing to nil when the receiver was nil.
Arrays and slicesSupportedSupportedSlices are backed by arrays; append copies. len / cap / append require import Gsharp.Extensions.Go (GS0317); the .NET-idiomatic alternative is .Length and (for mutable lists) List[T].Add.
MapsSupportedSupportedBacked by Dictionary[K,V]; delete and len are implemented. Both require import Gsharp.Extensions.Go (GS0317); .NET-idiomatic alternatives are .Remove(k) and .Count. Iterable with range for: for k, v in m destructures entries, for kv in m yields KeyValuePair[K,V]; order unspecified.
Tuples and multi-returnSupportedSupportedMulti-value return syntax is represented as tuple literals.
Struct literalsSupportedSupportedField initialization and field access are implemented.
Data classes, data structs, with/copySupportedSupporteddata class (reference) and data struct (value) synthesise equality, with-copy, and deconstruction. The record keyword is not supported; migrate to data struct (preserves value semantics) or data class (reference semantics).
Inline structsSupportedSupportedExactly one field; participates in structural equality.
Classes and primary constructorsSupportedPartially supportedThe evaluator supported G# classes, with limited CLR base-initializer modeling.
Explicit class init constructorsSupportedSupportedG# class constructors are parsed, bound, and evaluated.
InterfacesSupportedSupported for checking/upcastsDefault-interface methods, static-virtual interface members declared inside the interface's shared { … } block, private interface helper methods — instance helpers in the interface body, static helpers as private func inside the interface's shared { … } block — and the explicit-base interface call syntax base[IFoo].M(...) for DIM diamond disambiguation are supported.
PropertiesSupportedSupportedAuto/computed and static/shared forms are represented.
EventsSupportedSupportedG# and CLR event subscription paths exist.
Static/shared membersSupportedSupportedDeclared in a shared { ... } block.
Function types, literals, closuresSupportedSupportedDelegate conversions are strongest on the emit path.
Generics and method inferenceSupportedSupported for binding/evaluationReified CLR generics: user-declared generic types/methods emit GenericParam rows; signatures over T encode Var/MVar; closed CLR generics over an in-scope type parameter (List[T]) emit honest GenericInstantiation blobs; open-bearing delegates (func(T) U) dispatch through FuncN::InvokeMemberRefs on constructedTypeSpec`.
Variance and constraintsSupported semanticallySupported semanticallyDiagnostics include GS0150 through GS0153.
By-ref and pointersPartialLimited/not supported& / * / *T for CLR ref/out/in interop; ref returns auto-dereference in rvalue position. The evaluator rejected generic address/deref execution.
ref/out/in parametersSupportedSupportedDeclaration-site and call-site modifiers; diagnostics GS0235GS0243. Includes out var/let/_ inline declarations.
Ref-aliasing locals (let ref / var ref)SupportedSupportedLocal whose IL slot is T& and aliases another lvalue. Diagnostics GS0256GS0258.
ref-returning functionsSupportedSupportedfunc f(...) ref T { ... } paired with return ref <lvalue>. Diagnostics GS0248GS0255.
scoped parameter modifierSupportedSupportedConstrains a ref struct / managed-pointer parameter from escaping; enforced by GS9004 / GS9006.
Spans and ref struct typesMostly supportedLimitedStack-only consumption of Span[T] / ReadOnlySpan[T] and user ref struct X: element read/write, []T→span conversion, closed generic value-type fields. Escape rules are GS0219; ReadOnlySpan[T] writes are GS0226. Full ref-safe-to-escape analysis is not implemented.

Declarations and members

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
Top-level functions and variablesSupportedSupportedvar, let, and const are implemented. The legacy := short variable declaration is not supported; the parser hard-rejects it with GS0305.
Visibility modifiersSupportedSupportedpublic, internal, and private; invalid locations report GS0180.
Receiver methods and extension functionsSupportedSupportedG# receiver style and imported CLR extension dispatch. The inferred receiver-clause form warns (GS0314) when it targets an owned class or struct; func extension (r T) M() explicitly declares an extension for enum/owned receivers. In-body declarations remain canonical for real owned-type methods.
Operator declarationsSupportedSupported where the evaluator invoked user/CLR op pathsReceiver and in-body operator declarations map to CLR op_* names. In-place compound operators such as operator += are void instance members with one operand and take precedence over binary fallback.
Interface implementationSupportedSupported for checks/upcastsMissing members and sealed-interface violations are diagnosed. Explicit qualifier clauses (func (IFoo) M, prop (IFoo) P, event (IFoo) E) support distinct method/property/indexer/event implementations and static interface members.
Inheritance and overridesSupportedPartially supportedBase classes must be open; override diagnostics are implemented.
Default parameter values in G# declarationsSupportedSupportedOptional parameters carry compile-time-constant defaults; rule violations report GS0265.
Method overloading (user functions)SupportedSupportedFunctions can carry overload sets differing by parameter types, ref-kinds, or generic-parameter constraints (where T : class / where T : struct); duplicates report GS0264, ambiguous calls report GS0266 or GS0160, no-applicable reports GS0267.
Variadic parameters (name ...T)Supported (all declaration sites)Supported (all declaration sites)Canonical Go-style spelling name ...T; body sees []T; at most one variadic per signature and must be last (GS0145, GS0364). Call site packs N trailing args into a fresh []T; a single trailing []T argument passes through unwrapped (identity preserved). The emitter stamps [System.ParamArrayAttribute] so C# / F# / VB consumers see it as params T[]. The C# params keyword is rejected with GS0363 pointing at the canonical form. Accepted on top-level func, class instance/static methods, interface methods (incl. default-body), constructors, lambdas, and named delegate declarations.
Named delegate typesSupportedSupportedtype X = delegate func(...) declares a real CLR MulticastDelegate-derived type; generic delegates (type X[T any] = delegate func(...)) supported; diagnostic GS0233.

Statements and control flow

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
ifSupportedSupportedIncludes simple-statement form. The if let name = expr { ... } [else { ... }] binding form strips a nullable layer and narrows name to the underlying type inside the then-branch. if is also available as a value-producing expression — see the If expression and if let expression rows below.
if expressionSupportedSupportedlet x = if cond { a } else { b } and else if chains in value position. Requires a terminal else (GS0276); blocks must end in a value-producing expression (GS0277); branches with no common type report GS0263 (shared with the ternary). Lowers through the same BoundConditionalExpression / BoundBlockExpression nodes the ternary and switch expression use.
if let expressionSupportedSupportedif let a = e [, let b = e2]* [&& guard] { value } else { value } in value position. Terminal else required; bindings short-circuit left-to-right and are visible in later initializers, the guard, and the then-branch only. A top-level && after the last binding delimits the optional bool guard (parenthesize a logical-and that belongs to an initializer). Same GS0276 / GS0277 / GS0263 branch rules as the if expression, plus GS0296 for a non-nullable initializer. Lowers through the same BoundConditionalExpression / BoundBlockExpression nodes.
guard letSupportedSupportedguard let name = expr else { ... } binds name for the remainder of the enclosing block and requires the else clause to unconditionally exit (GS0297).
for condition, clause, infinite loopsSupportedSupportedCompanion while and do-while forms are supported.
for x in collectionSupportedSupportedCanonical in form over arrays, slices, strings, sequences, CLR enumerables, and map[K,V] (for k, v in m destructures entries; for kv in m yields KeyValuePair[K,V]; iteration order unspecified). The legacy for x := range collection Go-style spelling is not supported.
Ellipsis loopsSupportedSupportedfor i in start ... end. The legacy for i := start ... end spelling is not supported.
while, while let, and do-whileSupportedSupportedwhile cond { ... } (boolean pre-test), while let name = nullableExpr { ... } (body-scoped nullable binding re-evaluated before each iteration), and do { ... } while cond (post-test).
break and continue (with optional loop labels)SupportedSupportedInvalid locations are diagnosed. Loop labels (label: for ..., break label, continue label) are supported; diagnostics GS0293GS0295.
Multi-assignment and deconstructionSupportedSupportedMulti-assignment accepts locals, fields, properties, arrays, maps, CLR indexers, nested member targets, pointer dereferences, and a tuple-valued single RHS. Target components evaluate before RHS values; writes occur left-to-right. Arity and invalid-target diagnostics are GS0167 and GS0526.
Null-coalescing compound assignment (??=)SupportedSupporteda ??= b writes b only when a reads as nil; RHS short-circuits otherwise. Receiver and index expressions evaluated exactly once. Works on locals, fields, properties, and indexers. Non-nullable LHS reports GS0298; non-assignable LHS reports GS0299.
switch statementsSupportedSupportedCases do not fall through. Flow analysis narrows the discriminator inside type-pattern arms (case d is T) and lifts a common narrowing into the rest of the enclosing block when the switch is exhaustive and every non-exiting arm contributes the same narrowing.
Switch expressionsSupportedSupportedExhaustiveness and arm type diagnostics implemented.
PatternsSupportedSupportedConstant, relational, type, property, list/rest, discard, parenthesized, and not / and / or patterns work in switches and boolean is; type-plus-property patterns narrow composed and operands.
fallthroughNot supportedNot supportedReserved and diagnosed as GS0168.
try, catch, finally, throwSupportedSupportedCLR exception model.
usingSupportedSupported if lowered/bound disposableResource-scope variable declaration.
deferSupported by binding/lowering intentSupported when lowered before evaluationBinder requires a call expression.
gotoSupportedSupportedlabel: statement and goto label support forward references and outward jumps; entering a nested block or exception handler is rejected.

Expressions

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
Calls and generic callsSupportedSupportedBracketed type arguments.
Named argumentsSupportedSupportedFoo(timeout: 30, retries: 3) for free functions, user methods/constructors, extension functions, and inherited CLR methods (including delegate Invoke). Named arguments use :; = is an ordinary assignment expression and an ambiguous bare assignment warns with GS0524. Indirect calls through a function-typed variable and variadic targets are excluded.
Conditional (?:) ternary expressionSupportedSupportedcond ? a : b is a normal expression. GS0263 covers the "no common type" failure.
General block expressionsSupportedSupported{ statements... trailingExpression } works in any expression position, with lexical scope, target typing, async/iterator spilling, and exactly-once evaluation. Missing tail: GS0277; expression trees: GS0473.
Conditional ref-arguments (ref cond ? a : b)SupportedSupportedBranches must produce same-typed lvalues. Diagnostics GS0260GS0262.
Struct, array, map, and collection literalsSupportedSupportedArray/slice and CLR collection initializers accept ...source spread elements, evaluated once in lexical order with per-element conversion. Named object literals accept one leading spread for explicit structural projection.
Structural projectionSupportedSupportedCompatible public fields/properties can implicitly project into a safely constructible concrete target. Target{ ...source, Member: override } makes projection explicit; required constructor inputs must be supplied and explicit entries win.
Indexing and index assignmentSupportedSupportedArrays, slices, maps, and imported CLR indexers.
Null-conditional accessSupportedSupported?. and ?[i] are represented in the bound tree. ?[i] covers arrays, slices, maps, and CLR indexers; non-nullable receiver warns GS0300; ?[i] rejected as assignment LHS (GS0301).
Type operatorsSupportedSupportedtypeof(...) and nameof(...).
default(T) and bare default literalSupportedSupporteddefault(T) for any type expression; bare default valid in target-typed positions (let/var with explicit type, return with known return type, typed call argument, ?: branch typed by sibling). Diagnostic GS0362 when no target type is available.
Smart casts / flow narrowingSupportedSupportedis / !is on a local, parameter, or read-only top-level let narrows the receiver to the tested type. Composes through !, &&, `
Trailing func lambdasSupportedSupportedcall(...) func(...) { ... } form.
Arrow lambda expressions ((x int32) -> body)SupportedSupportedParameter list is always parenthesised; body is a single expression or a brace block whose trailing expression is the value. Captures outer locals. Lambda parameter type inference and (T) -> R function-type syntax are supported separately.

Concurrency, async, and iterators

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
goSupportedSupported with scheduling limitsOperand must be a call expression. Per-file import Gsharp.Extensions.Go is required (GS0316).
scope structured concurrencySupportedSupportedChild tasks are joined and failures propagate. Not gated.
Channels, send, receive, closeSupportedSupportedBacked by System.Threading.Channels. Per-file import Gsharp.Extensions.Go is required (GS0316).
selectSupportedSupportedReceive, receive-bind, send, and default cases. Per-file import Gsharp.Extensions.Go is required (GS0316).
async func and awaitSupportedSupported by blockingEmit has state machines; the evaluator blocked on awaiters. Not gated.
Async state-machine edge casesPartialN/AUnsupported emit shapes report GS0190.
sequence[T] and yieldSupportedSupportedSync iterator state machines in emit; the evaluator collected sequence values.
async sequence[T] and await forSupportedSupported by blockingMaps to IAsyncEnumerable[T].

CLR interop

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
Imported constructorsSupportedSupported by reflectionIncludes simple-name construction when imported.
Imported instance/static methodsSupportedSupported by reflectionOverload resolution and conversions apply.
Imported fields/properties/indexersSupportedSupported by reflectionReads and writes are represented separately.
Imported eventsSupportedSupported+= and -= bind to event add/remove.
Imported extension methodsSupportedSupportedUses imported [Extension] classes.
Imported optional/default argumentsSupportedSupportedVerified by sample coverage.
Function literal to delegateSupportedPartialSome marshalling scenarios are emit-path only.
Method group to delegateSupportedSupported in covered scenariosIncludes imported CLR method groups.
Imported operator overloads and conversionsSupportedSupported where the evaluator invoked pathsBound as CLR operator/conversion calls.
AttributesSupportedSemantically recognizedIncludes @Attribute sugar and @Obsolete; @DllImport opts into P/Invoke; @LibraryImport opts into the source-generator-shaped P/Invoke.
P/Invoke/externSupportedSupported (emit-only)Attribute-driven via @DllImport("lib") on a ;-body func, or via the source-generator-shaped @LibraryImport("lib", StringMarshalling: …), which is AOT-friendly with an explicit IL stub. v1 marshals primitives, string, *T (byref), slices of primitives, and blittable / explicit-layout structs via @StructLayout(LayoutKind.…) + @FieldOffset(N). ref / out / in parameters are supported for blittable pointees (primitives and @StructLayout structs); the runtime marshals the byref slot as T* to the unmanaged callee. Function-pointer marshalling supports both managed delegate callbacks (@UnmanagedFunctionPointer(CallingConvention.Cdecl) on the delegate type) and raw unmanaged[Cdecl] (T) -> R function pointers (encoded as ELEMENT_TYPE_FNPTR in metadata). Per-parameter @MarshalAs(UnmanagedType.…) overrides opt a parameter into a different unmanaged form (LPWStr for Windows …W entry-points, LPUTF8Str for modern C APIs, I4 to widen a bool to a C int flag, LPArray with SizeParamIndex: for sibling-sized buffers, etc.).

Gsharp.Extensions helper namespaces

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
Gsharp.Extensions.OptionalSupportedSupportedExtension helpers on T? (Map, FlatMap, OrElse, OrCompute, OrThrow, IfPresent, Filter). Value-typed (T : struct) helpers carry a *Value suffix and require import Gsharp.Extensions.Optional.
Gsharp.Extensions.SequencesSupportedSupportedStatic builders (Range, RangeStep, Iterate, Repeat, Of, Empty), transformers (Windowed, Chunked, Indexed, Pairwise, Interleave), safe terminals (FirstOrNil, LastOrNil, SingleOrNil plus *ValueOrNil companions), and G#-shaped collectors (ToSlice, ToMap). Requires import Gsharp.Extensions.Sequences.
Gsharp.Extensions.Go (gate)SupportedSupportedPer-file import Gsharp.Extensions.Go unlocks the Go-flavored concurrency surface and the Go-style built-ins len, cap, append, delete, make.
No auto-import policyN/AN/ANothing under Gsharp.Extensions.* is auto-imported — even when implicit imports are enabled. Each namespace is opt-in per file.

Tooling and build

FeatureEmit (current)Evaluator (removed Phase 3c)Notes
PE assembly emitSupportedN/ADirect System.Reflection.Metadata emitter.
Portable PDB, Source Link, embedded sources, deterministic IDsSupportedN/AEmit-only debug information.
Reference assembliesSupportedN/ASDK can produce reference assemblies.
SDK .gsproj build/run/packSupportedN/AGsharp.NET.Sdk integrates with MSBuild and dotnet.
REPLSupportedRemovedgsi starts the emitted interactive REPL when no file is supplied.
Language server and VS Code extensionN/AN/APull-based diagnostics, semantic tokens, hover for CLR XML docs, CodeLens reference counts on members of types/structs/interfaces/enums, signature help, inlay hints, completion, go-to-definition, references, rename, formatting, debug + test integration.
VS Code color themesN/AN/ASix bundled themes (Ember, Magma, Synthwave — Dark + Light each).