You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicdecimalFoo(decimalx){if((double)x>Conversions.ToDouble("0")){return(decimal)((double)x*Conversions.ToDouble("30,55"));}returndefault;// NOTE: default is a C# 7 feature}
Expected output
publicdecimalFoo(decimalx){if((double)x>Conversions.ToDouble("0")){return(decimal)((double)x*Conversions.ToDouble("30,55"));}returndefault(decimal);// NOTE: default(decimal) (this works in C# 6)}
Converter code
varconversionOptions=newCodeWithOptions(code).SetFromLanguage(LanguageNames.VisualBasic,14).SetToLanguage(LanguageNames.CSharp,6)// NOTE: Language version is set to 6.WithTypeReferences(references);varconversationResult=awaitCodeConverter.ConvertAsync(conversionOptions)
Details
Product in use: NuGet-package "ICSharpCode.CodeConverter"
Version in use: 8.5.0.374
The text was updated successfully, but these errors were encountered:
I'm afraid the option to control the version (especially of the output) has only a small influence - it is not strictly adhered to. It probably should have been deprecated long ago. It's not really feasible to support multiple different language versions elegantly unfortunately. I'll leave this issue open to track deprecating the options so as not to mislead people!
What I'd recommend is to use a c#code formatter to reformat the result to your preferred style
VB.Net input code
Erroneous output
Expected output
Converter code
Details
The text was updated successfully, but these errors were encountered: