@@ -475,21 +475,88 @@ public void Test()
475475 public async Task EmptyArrayExpressionAsync ( )
476476 {
477477 await TestConversionVisualBasicToCSharpAsync ( @"
478- Public Class Issue495
478+ Public Class Issue495AndIssue713
479479 Public Function Empty() As Integer()
480+ Dim emptySingle As IEnumerable(Of Integer) = {}
481+ Dim initializedSingle As IEnumerable(Of Integer) = {1}
482+ Dim emptyNested As Integer()() = {}
483+ Dim initializedNested(1)() As Integer
484+ Dim empty2d As Integer(,) = {{}}
485+ Dim initialized2d As Integer(,) = {{1}}
480486 Return {}
481487 End Function
482488End Class" , @"using System;
489+ using System.Collections.Generic;
490+
491+ public partial class Issue495AndIssue713
492+ {
493+ public int[] Empty()
494+ {
495+ IEnumerable<int> emptySingle = Array.Empty<int>();
496+ IEnumerable<int> initializedSingle = new[] { 1 };
497+ var emptyNested = Array.Empty<int[]>();
498+ var initializedNested = new int[2][];
499+ var empty2d = new int[,] { { } };
500+ var initialized2d = new[,] { { 1 } };
501+ return Array.Empty<int>();
502+ }
503+ }" ) ;
504+ }
505+
506+ [ Fact ]
507+ public async Task InitializedArrayExpressionAsync ( )
508+ {
509+ await TestConversionVisualBasicToCSharpAsync ( @"
510+ Public Class Issue713
511+ Public Function Empty() As Integer()
512+ Dim initializedSingle As IEnumerable(Of Integer) = {1}
513+ Dim initialized2d As Integer(,) = {{1}}
514+ Return {}
515+ End Function
516+ End Class" , @"using System;
517+ using System.Collections.Generic;
483518
484- public partial class Issue495
519+ public partial class Issue713
485520{
486521 public int[] Empty()
487522 {
523+ IEnumerable<int> initializedSingle = new[] { 1 };
524+ var initialized2d = new[,] { { 1 } };
488525 return Array.Empty<int>();
489526 }
490527}" ) ;
491528 }
492529
530+ [ Fact ]
531+ public async Task EmptyArrayParameterAsync ( )
532+ {
533+ await TestConversionVisualBasicToCSharpAsync ( @"Public Class VisualBasicClass
534+ Public Sub s()
535+ If Validate({}) Then
536+ End If
537+ End Sub
538+ Private Function Validate(w As IEnumerable(Of Int16)) As Boolean
539+ Return True
540+ End Function
541+ End Class" , @"using System;
542+ using System.Collections.Generic;
543+
544+ public partial class VisualBasicClass
545+ {
546+ public void s()
547+ {
548+ if (Validate(Array.Empty<short>()))
549+ {
550+ }
551+ }
552+
553+ private bool Validate(IEnumerable<short> w)
554+ {
555+ return true;
556+ }
557+ }" ) ;
558+ }
559+
493560 [ Fact ]
494561 public async Task Empty2DArrayExpressionAsync ( )
495562 {
0 commit comments