Skip to content

Commit 21e1599

Browse files
Don't do any extra qualification for generic names
Doesn't cause any negative effects on tests
1 parent a4390cc commit 21e1599

4 files changed

Lines changed: 6 additions & 24 deletions

File tree

CodeConverter/CSharp/ExpressionNodeVisitor.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,26 +1174,7 @@ public override async Task<CSharpSyntaxNode> VisitGenericName(VBasic.Syntax.Gene
11741174
{
11751175
var symbol = GetSymbolInfoInDocument<ISymbol>(node);
11761176
var genericNameSyntax = await GenericNameAccountingForReducedParametersAsync(node, symbol);
1177-
ExpressionSyntax name = genericNameSyntax;
1178-
1179-
1180-
if (symbol?.IsStatic == true && symbol.ContainingSymbol != null) {
1181-
1182-
if (!node.Parent.IsKind(VBasic.SyntaxKind.SimpleMemberAccessExpression, VBasic.SyntaxKind.QualifiedName)) {
1183-
1184-
string lhs;
1185-
if (symbol.ContainingSymbol.IsType()) {
1186-
lhs = CommonConversions.GetTypeSyntax(symbol.ContainingSymbol.GetSymbolType()).ToString();
1187-
} else if (symbol.ContainingSymbol.IsNamespace() && symbol.ContainingNamespace.IsGlobalNamespace) {
1188-
return SyntaxFactory.AliasQualifiedName("global", genericNameSyntax);
1189-
} else {
1190-
lhs = symbol.ContainingSymbol.ToString();
1191-
}
1192-
name = SyntaxFactory.QualifiedName(SyntaxFactory.ParseName(lhs), genericNameSyntax);
1193-
}
1194-
}
1195-
1196-
return AddEmptyArgumentListIfImplicit(node, name);
1177+
return AddEmptyArgumentListIfImplicit(node, genericNameSyntax);
11971178
}
11981179

11991180
/// <summary>

Tests/CSharp/ExpressionTests/BinaryExpressionTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ private void TestMethod()
180180
}
181181
1 target compilation errors:
182182
CS0266: Cannot implicitly convert type 'double' to 'int'. An explicit conversion exists (are you missing a cast?)");
183+
//BUG: To avoid compilation error, should be z = (int)Math.Round(z / 3d);
183184
}
184185

185186
[Fact]

Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/ConsoleApp4/My Project/MyNamespace.Static.2.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/WindowsAppVb/My Project/MyNamespace.Dynamic.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)