diff --git a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb index d1e63f6788b1e1e18d68e37cba6dafed51e4354f..49a926fb2080ed535b55039f52af618b8347238b 100644 --- a/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb +++ b/src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb @@ -948,7 +948,9 @@ Namespace Microsoft.CodeAnalysis.Semantics Dim body As Lazy(Of IOperation) = New Lazy(Of IOperation)(Function() Create(boundForToStatement.Body)) Dim nextVariables As Lazy(Of ImmutableArray(Of IOperation)) = New Lazy(Of ImmutableArray(Of IOperation))( Function() - Return boundForToStatement.NextVariablesOpt.NullToEmpty.Select(Function(n) Create(n)).ToImmutableArray + Return If(boundForToStatement.NextVariablesOpt.IsDefault, + ImmutableArray(Of IOperation).Empty, + boundForToStatement.NextVariablesOpt.SelectAsArray(Function(n) Create(n))) End Function) Dim syntax As SyntaxNode = boundForToStatement.Syntax Dim type As ITypeSymbol = Nothing