Spot the bug in overload lookup

from Reflection
C# 14 / .NET 10 intermediate 4 min 1 issue to find

Find why method resolution fails after the second overload is added.

csharp
using System;
using System.Reflection;

Type type = typeof(Formatter);
MethodInfo format = type.GetMethod("Format")!;
Console.WriteLine(format.Invoke(new Formatter(), [12m]));

public sealed class Formatter
{
    public string Format(decimal value) => $"{value:F2}";
    public string Format(decimal value, string unit) => $"{value:F2} {unit}";
}
Open in playground
Report an error