VB -> C#: Add null if we have only space in function parameter
See original GitHub issueInput code
Call mySuperFunction(strSomething, , optionalSomething)
Erroneous output
{
;
#error Cannot convert CallStatementSyntax - see comment for details
/* Cannot convert CallStatementSyntax, CONVERSION ERROR: Conversion for OmittedArgument not implemented, please report this issue in '' at character 81
at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.DefaultVisit(SyntaxNode node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\ExpressionNodeVisitor.cs:line 82
at ICSharpCode.CodeConverter.CSharp.CommentConvertingVisitorWrapper`1.Visit(SyntaxNode node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\CommentConvertingVisitorWrapper.cs:line 23
at ICSharpCode.CodeConverter.CSharp.SyntaxNodeVisitorExtensions.AcceptAsync[T](SyntaxNode node, CommentConvertingVisitorWrapper`1 visitorWrapper) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\SyntaxNodeVisitorExtensions.cs:line 17
at ICSharpCode.CodeConverter.CSharp.SyntaxNodeVisitorExtensions.<>c__DisplayClass4_0`2.<<AcceptAsync>b__0>d.MoveNext() in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\SyntaxNodeVisitorExtensions.cs:line 38
--- End of stack trace from previous location where exception was thrown ---
at ICSharpCode.CodeConverter.Shared.AsyncEnumerableTaskExtensions.SelectAsync[TArg,TResult](IEnumerable`1 source, Func`2 selector)
at ICSharpCode.CodeConverter.CSharp.SyntaxNodeVisitorExtensions.AcceptAsync[TGeneral,TSpecific](IEnumerable`1 nodes, CommentConvertingVisitorWrapper`1 visitorWrapper) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\SyntaxNodeVisitorExtensions.cs:line 39
at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.<>c__DisplayClass66_0.<<VisitInvocationExpression>g__CreateElementAccess|1>d.MoveNext() in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\ExpressionNodeVisitor.cs:line 725
--- End of stack trace from previous location where exception was thrown ---
at ICSharpCode.CodeConverter.CSharp.ExpressionNodeVisitor.VisitInvocationExpression(InvocationExpressionSyntax node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\ExpressionNodeVisitor.cs:line 726
at ICSharpCode.CodeConverter.CSharp.CommentConvertingVisitorWrapper`1.Visit(SyntaxNode node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\CommentConvertingVisitorWrapper.cs:line 23
at ICSharpCode.CodeConverter.CSharp.SyntaxNodeVisitorExtensions.AcceptAsync[T](SyntaxNode node, CommentConvertingVisitorWrapper`1 visitorWrapper) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\SyntaxNodeVisitorExtensions.cs:line 17
at ICSharpCode.CodeConverter.CSharp.MethodBodyExecutableStatementVisitor.VisitCallStatement(CallStatementSyntax node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\MethodBodyExecutableStatementVisitor.cs:line 744
at ICSharpCode.CodeConverter.CSharp.ByRefParameterVisitor.CreateLocals(VisualBasicSyntaxNode node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\ByRefParameterVisitor.cs:line 53
at ICSharpCode.CodeConverter.CSharp.ByRefParameterVisitor.AddLocalVariables(VisualBasicSyntaxNode node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\ByRefParameterVisitor.cs:line 49
at ICSharpCode.CodeConverter.CSharp.CommentConvertingMethodBodyVisitor.ConvertWithTrivia(SyntaxNode node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\CommentConvertingMethodBodyVisitor.cs:line 44
at ICSharpCode.CodeConverter.CSharp.CommentConvertingMethodBodyVisitor.DefaultVisit(SyntaxNode node) in D:\GitWorkspace\CodeConverter\ICSharpCode.CodeConverter\CSharp\CommentConvertingMethodBodyVisitor.cs:line 35
Input:
Call mySuperFunction(strSomething, , optionalSomething)
*/
}
Expected output
{
mySuperFunction(strSomething, null, optionalSomething);
}
Details
- Product in use: e.g. codeconverter.icsharpcode.net
- Version in use: 7.3.0.0
- Did you see it working in a previous version, which? No
- Any other relevant information to the issue, or your interest in contributing a fix.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
vb.net - Empty string is not clear space character?
Try this method to check for blank strings. It is different from the Trim() versions in that it does not allocate a new...
Read more >String.IsNullOrWhiteSpace(String) Method (System)
Indicates whether a specified string is null, empty, or consists only of white-space characters.
Read more >String.IsNullOrEmpty(String) Method (System)
You can use the IsNullOrWhiteSpace method to test whether a string is null , its value is String.Empty, or it consists only of...
Read more >How to check if a string has only whitespace or is empty in C#
The IsNullOrWhiteSpace () is used to indicate whether a specified string is empty, null , or contains only whitespace. Syntax. string.IsNullOrWhiteSpace(str) ...
Read more >Strings of Zero Length Not Equivalent To NULL - Ask TOM
It seems that vb/asp doesn't handle NULL. It crashes if we assign NULL values to variables and try to do some string operation....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@GrahamTheCoder This is not fixed. Try to convert this:
Error:
Ah, ok 😉 The parameter in my code was optional string, not optional bool like in this issue