提交 e4b34b77 编写于 作者: C CyrusNajmabadi

Simplify code.

上级 c109bf4f
......@@ -78,7 +78,7 @@ protected override async Task<Document> GetChangedDocumentAsync(CancellationToke
var result = await CodeGenerator.AddMemberDeclarationsAsync(
_document.Project.Solution,
_state.ContainingType,
fields.Cast<ISymbol>().Concat(constructor),
fields.Concat(constructor),
new CodeGenerationOptions(
contextLocation: syntaxTree.GetLocation(_state.TextSpan),
afterThisLocation: afterThisLocation),
......
......@@ -219,7 +219,7 @@ private async Task<(Document, bool addedFields)> GenerateFieldDelegatingConstruc
var result = await codeGenerationService.AddMembersAsync(
_document.Project.Solution,
_state.TypeToGenerateIn,
fields.Cast<ISymbol>().Concat(constructor),
fields.Concat(constructor),
new CodeGenerationOptions(_state.Token.GetLocation()),
_cancellationToken)
.ConfigureAwait(false);
......
......@@ -63,7 +63,7 @@ internal static partial class ICodeDefinitionFactoryExtensions
: factory.CreateArguments(constructor.Parameters));
}
public static (ImmutableArray<IFieldSymbol> fields, IMethodSymbol constructor) CreateFieldDelegatingConstructor(
public static (ImmutableArray<ISymbol> fields, ISymbol constructor) CreateFieldDelegatingConstructor(
this SyntaxGenerator factory,
Compilation compilation,
string typeName,
......@@ -90,7 +90,7 @@ internal static partial class ICodeDefinitionFactoryExtensions
statements: statements,
thisConstructorArguments: GetThisConstructorArguments(containingTypeOpt, parameterToExistingFieldMap));
return (fields, constructor);
return (ImmutableArray<ISymbol>.CastUp(fields), constructor);
}
private static ImmutableArray<SyntaxNode> GetThisConstructorArguments(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册