using System;
using System.Collections.Generic;
using System.Linq;
public class Options {
public int Foo { get; set; }
public int Bar { get; set; }
}
public class Program
{
public static void DoStuff(Options options) {
// ...
public static void Main()
// This compiles, using C#9's new partial type inference
// <https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/target-typed-new>
DoStuff(new() { Foo = 123 });
// But if you uncomment this overload, it doesn't any more,
// as the call on line 19 becomes ambiguous
//public static void DoStuff(string blah) {}