Files
PURErat-crack-scode/decompiled/Libraries/microsoft.codeanalysis.csharp/Microsoft.CodeAnalysis.CSharp.Symbols/SynthesizedReadOnlyListMethod.cs
T

31 lines
1.3 KiB
C#
Raw Normal View History

2026-08-27 10:56:38 -06:00
namespace Microsoft.CodeAnalysis.CSharp.Symbols;
internal sealed class SynthesizedReadOnlyListMethod : SynthesizedImplementationMethod
{
private readonly GenerateMethodBodyDelegate _generateMethodBody;
internal override bool SynthesizesLoweredBoundBody => true;
internal SynthesizedReadOnlyListMethod(SynthesizedReadOnlyListTypeSymbol containingType, MethodSymbol interfaceMethod, GenerateMethodBodyDelegate generateMethodBody)
: base(interfaceMethod, containingType)
{
_generateMethodBody = generateMethodBody;
}
internal override void GenerateMethodBody(TypeCompilationState compilationState, BindingDiagnosticBag diagnostics)
{
SyntheticBoundNodeFactory syntheticBoundNodeFactory = new SyntheticBoundNodeFactory(this, (SyntaxNode)(object)this.GetNonNullSyntaxNode(), compilationState, diagnostics);
syntheticBoundNodeFactory.CurrentFunction = this;
try
{
BoundStatement body = _generateMethodBody(syntheticBoundNodeFactory, this, _interfaceMethod);
syntheticBoundNodeFactory.CloseMethod(body);
}
catch (SyntheticBoundNodeFactory.MissingPredefinedMember missingPredefinedMember)
{
((BindingDiagnosticBag)diagnostics).Add(missingPredefinedMember.Diagnostic);
syntheticBoundNodeFactory.CloseMethod(syntheticBoundNodeFactory.ThrowNull());
}
}
}