Bug in TypeBuilderBase
Closed this issue · 2 comments
Illeris commented
Flaw in
protected BaseListSyntax CreateBaseList()
{
if (!_inheritance.Any())
{
return null;
}
return BaseList(
SeparatedList<BaseTypeSyntax>(
_inheritance.Select(i => SimpleBaseType(TypeGenerator.Create(i))),
_inheritance.Select(i => Token(SyntaxKind.CommaToken))));
}
No matter how many base classes, a "," is always appended to the base class list.
Illeris commented
Possible fix:
`
protected BaseListSyntax CreateBaseList()
{
if (!_inheritance.Any())
{
return null;
}
return BaseList(
SeparatedList<BaseTypeSyntax>(
_inheritance.Select(i => SimpleBaseType(TypeGenerator.Create(i))),
Enumerable.Range(0, _inheritance.Count - 1).Select(_ => SyntaxFactory.Token(SyntaxKind.CommaToken))));
}
`
MilleBo commented
A bit late but thanks for reporting and this is now fixed and will come in next nuget release.