Browse Source

Fixed SD2-996: C# assigned generic variables not converted correctly to VB.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1726 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
afe45ea0dd
  1. 6
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs
  2. 8
      src/Libraries/NRefactory/Test/Output/VBNet/CSharpToVBConverterTest.cs

6
src/Libraries/NRefactory/Project/Src/PrettyPrinter/VBNet/VBNetOutputVisitor.cs

@ -2321,10 +2321,8 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -2321,10 +2321,8 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
public object VisitDefaultValueExpression(DefaultValueExpression defaultValueExpression, object data)
{
outputFormatter.PrintToken(Tokens.Default);
outputFormatter.PrintToken(Tokens.OpenParenthesis);
nodeTracker.TrackedVisit(defaultValueExpression.TypeReference, data);
outputFormatter.PrintToken(Tokens.CloseParenthesis);
// assigning nothing to a generic type in VB compiles to a DefaultValueExpression
outputFormatter.PrintToken(Tokens.Nothing);
return null;
}

8
src/Libraries/NRefactory/Test/Output/VBNet/CSharpToVBConverterTest.cs

@ -407,11 +407,17 @@ namespace ICSharpCode.NRefactory.Tests.PrettyPrinter @@ -407,11 +407,17 @@ namespace ICSharpCode.NRefactory.Tests.PrettyPrinter
"\tProperty Name() As String\n" +
"End Interface");
}
[Test]
public void ImportAliasPrimitiveType()
{
TestProgram("using T = System.Boolean;", "Imports T = System.Boolean\r\n");
}
[Test]
public void DefaultExpression()
{
TestStatement("T oldValue = default(T);", "Dim oldValue As T = Nothing");
}
}
}

Loading…
Cancel
Save