Context
When removing #nullable disable directives from the LanguageModel Grammar files, Superpower's OptionalOrDefault<T>() requires TokenListParser<TKind, T?> but our grammar parsers return TokenListParser<TKind, T> (non-nullable). This causes CS8620 errors.
Current workaround
ParserNullabilityExtensions.AsNullable<TKind, T>() in src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs bridges this by converting the parser's type parameter to nullable at the type level.
Desired resolution
Investigate whether a newer version of Superpower provides nullable-annotated APIs, or whether we can contribute nullable annotations upstream. If so, this workaround can be removed.
🤖 Generated with Claude Code
Context
When removing
#nullable disabledirectives from the LanguageModel Grammar files, Superpower'sOptionalOrDefault<T>()requiresTokenListParser<TKind, T?>but our grammar parsers returnTokenListParser<TKind, T>(non-nullable). This causes CS8620 errors.Current workaround
ParserNullabilityExtensions.AsNullable<TKind, T>()insrc/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.csbridges this by converting the parser's type parameter to nullable at the type level.Desired resolution
Investigate whether a newer version of Superpower provides nullable-annotated APIs, or whether we can contribute nullable annotations upstream. If so, this workaround can be removed.
🤖 Generated with Claude Code