File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -637,24 +637,15 @@ private static ClassDeclarationSyntax GenerateInterfaceInformation(ComInterfaceI
637
637
638
638
static ExpressionSyntax CreateEmbeddedDataBlobCreationStatement ( ReadOnlySpan < byte > bytes )
639
639
{
640
- var literals = new LiteralExpressionSyntax [ bytes . Length ] ;
640
+ var literals = new CollectionElementSyntax [ bytes . Length ] ;
641
641
642
642
for ( int i = 0 ; i < bytes . Length ; i ++ )
643
643
{
644
- literals [ i ] = LiteralExpression ( SyntaxKind . NumericLiteralExpression , Literal ( bytes [ i ] ) ) ;
644
+ literals [ i ] = ExpressionElement ( LiteralExpression ( SyntaxKind . NumericLiteralExpression , Literal ( bytes [ i ] ) ) ) ;
645
645
}
646
646
647
- // new System.ReadOnlySpan<byte>(new[] { <byte literals> } )
648
- return ObjectCreationExpression (
649
- GenericName ( TypeNames . System_ReadOnlySpan )
650
- . AddTypeArgumentListArguments ( PredefinedType ( Token ( SyntaxKind . ByteKeyword ) ) ) )
651
- . AddArgumentListArguments (
652
- Argument (
653
- ArrayCreationExpression (
654
- ArrayType ( PredefinedType ( Token ( SyntaxKind . ByteKeyword ) ) , SingletonList ( ArrayRankSpecifier ( ) ) ) ,
655
- InitializerExpression (
656
- SyntaxKind . ArrayInitializerExpression ,
657
- SeparatedList < ExpressionSyntax > ( literals ) ) ) ) ) ;
647
+ // [ <byte literals> ]
648
+ return CollectionExpression ( SeparatedList ( literals ) ) ;
658
649
}
659
650
}
660
651
}
You can’t perform that action at this time.
0 commit comments