File tree Expand file tree Collapse file tree
ICSharpCode.CodeConverter/CSharp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,6 +105,10 @@ private TypeConversionKind AnalyzeConversion(Microsoft.CodeAnalysis.VisualBasic.
105105 }
106106 return TypeConversionKind . Implicit ;
107107 }
108+ else if ( csConversion . IsExplicit && csConversion . IsEnumeration )
109+ {
110+ return TypeConversionKind . Implicit ;
111+ }
108112 else if ( csConversion . IsExplicit && vbConversion . IsNumeric && vbType . TypeKind != TypeKind . Enum )
109113 {
110114 return TypeConversionKind . Explicit ;
Original file line number Diff line number Diff line change @@ -407,6 +407,34 @@ public void Bar(int x)
407407}" ) ;
408408 }
409409
410+ [ Fact ]
411+ public void IntToEnumArg ( )
412+ {
413+ TestConversionVisualBasicToCSharpWithoutComments ( @"Public Class Class1
414+ Sub Foo(ByVal arg As TriState)
415+ End Sub
416+
417+ Sub Main()
418+ Foo(0)
419+ End Sub
420+ End Class" ,
421+ @"using Microsoft.VisualBasic;
422+
423+ public class Class1
424+ {
425+ public void Foo(TriState arg)
426+ {
427+ }
428+
429+ public void Main()
430+ {
431+ Foo((TriState)0);
432+ }
433+ }" ) ;
434+ }
435+
436+
437+
410438 [ Fact ]
411439 public void EnumSwitch ( )
412440 {
You can’t perform that action at this time.
0 commit comments