Skip to content

Commit f4f96b2

Browse files
Reuse method so it's easy to tweak later
1 parent dbea120 commit f4f96b2

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

ICSharpCode.CodeConverter/CSharp/CommonConversions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public CommonConversions(Document document, SemanticModel semanticModel,
8181
var declaredSymbol = _semanticModel.GetDeclaredSymbol(name);
8282
var declaredSymbolType = declaredSymbol.GetSymbolType();
8383
var requireExplicitType = requireExplicitTypeForAll || vbInitializerType != null && !Equals(declaredSymbolType, vbInitializerType);
84-
var csTypeSyntax = (TypeSyntax)CsSyntaxGenerator.TypeExpression(declaredSymbolType);
84+
var csTypeSyntax = (TypeSyntax)GetTypeSyntax(declaredSymbolType);
8585

8686
bool isField = declarator.Parent.IsKind(SyntaxKind.FieldDeclaration);
8787

@@ -164,7 +164,7 @@ private async Task<CSharpSyntaxNode> GetInitializerFromNameAndType(ITypeSymbol t
164164
var rankSpecifiersWithSizes = await ConvertArrayRankSpecifierSyntaxes(name.ArrayRankSpecifiers, name.ArrayBounds);
165165
if (!rankSpecifiersWithSizes.SelectMany(ars => ars.Sizes).OfType<OmittedArraySizeExpressionSyntax>().Any())
166166
{
167-
var arrayTypeSyntax = (ArrayTypeSyntax) CsSyntaxGenerator.TypeExpression(typeSymbol);
167+
var arrayTypeSyntax = (ArrayTypeSyntax) GetTypeSyntax(typeSymbol);
168168
arrayTypeSyntax = arrayTypeSyntax.WithRankSpecifiers(rankSpecifiersWithSizes);
169169
initializer = SyntaxFactory.ArrayCreationExpression(arrayTypeSyntax);
170170
}

ICSharpCode.CodeConverter/CSharp/DeclarationNodeVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ public override async Task<CSharpSyntaxNode> VisitMethodStatement(VBSyntax.Metho
886886
var csIdentifier = CommonConversions.ConvertIdentifier(node.Identifier);
887887
// If the method is virtual, and there is a MyClass.SomeMethod() call,
888888
// we need to emit a non-virtual method for it to call
889-
var returnType = (TypeSyntax) (declaredSymbol != null ? _csSyntaxGenerator.TypeExpression(declaredSymbol.ReturnType) :
889+
var returnType = (TypeSyntax) (declaredSymbol != null ? CommonConversions.GetTypeSyntax(declaredSymbol.ReturnType) :
890890
await (node.AsClause?.Type).AcceptAsync(_triviaConvertingExpressionVisitor) ?? SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword)));
891891
if (accessedThroughMyClass)
892892
{

0 commit comments

Comments
 (0)