Skip to content

Commit

Permalink
fixes broken code generation after refactoring of array initializatio…
Browse files Browse the repository at this point in the history
…n code (#256)
  • Loading branch information
adrianoc committed Sep 30, 2024
1 parent 27ef4bb commit dd3e940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cecilifier.Core/AST/ArrayInitializationProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal static void InitializeUnoptimized<TElement>(ExpressionVisitor visitor,
var itemType = context.SemanticModel.GetTypeInfo(elements.Value[i]);
if (elementType.IsReferenceType && itemType.Type != null && itemType.Type.IsValueType)
{
context.EmitCilInstruction(visitor.ILVariable, OpCodes.Box, itemType.Type);
context.EmitCilInstruction(visitor.ILVariable, OpCodes.Box, context.TypeResolver.Resolve(itemType.Type));
}

context.EmitCilInstruction(visitor.ILVariable, stelemOpCode, stelemOpCode == OpCodes.Stelem_Any ? context.TypeResolver.Resolve(elementType) : null);
Expand Down

0 comments on commit dd3e940

Please sign in to comment.