Skip to content

[fix-finder] Fix broken string interpolation in LlvmIrInstructions error messages #11430

@github-actions

Description

@github-actions

Problem

Two error messages in LlvmIrInstructions.cs have broken string interpolation, causing exception messages to display incorrect text when thrown. One is missing interpolation braces (printing literal cond.Type instead of the actual type), and the other is missing a closing quote character.

Location

  • File: src/Xamarin.Android.Build.Tasks/Utilities/LlvmIrGenerator/LlvmIrInstructions.cs
  • Lines: 163, 221

Current Code

Line 163Br constructor: missing { } around cond.Type (prints literal text instead of the variable value):

throw new ArgumentException ($"Internal error: condition must refer to a variable of type 'bool', was 'cond.Type' instead", nameof (cond));

Line 221Call constructor: missing closing ' after {function.Signature.ReturnType}:

throw new ArgumentNullException ($"Internal error: function '{function.Signature.Name}' returns '{function.Signature.ReturnType} and thus requires a result variable", nameof (result));

Suggested Fix

Line 163 — Add interpolation braces around cond.Type:

throw new ArgumentException ($"Internal error: condition must refer to a variable of type 'bool', was '{cond.Type}' instead", nameof (cond));

Line 221 — Add the missing closing ' after the interpolation expression:

throw new ArgumentNullException ($"Internal error: function '{function.Signature.Name}' returns '{function.Signature.ReturnType}' and thus requires a result variable", nameof (result));

Reference

Line 445 in the same file shows the correct pattern for comparison:

throw new ArgumentException ($"Internal error: result must be a variable of type 'bool', was '{result.Type}' instead", nameof (result));

Guidelines

  • Preserve existing formatting (tabs, spaces before parentheses)
  • Minimal diff — only change the two affected string literals

Acceptance Criteria

  • Line 163: 'cond.Type''{cond.Type}' (add interpolation braces)
  • Line 221: '{function.Signature.ReturnType}'{function.Signature.ReturnType}' (add closing quote)
  • No other changes to the file
  • Build succeeds (dotnet build src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj)

Generated by Nightly Fix Finder · ● 2.6M ·

  • expires on May 28, 2026, 2:31 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions