Skip to content

Instantly share code, notes, and snippets.

@renatogroffe
Created January 6, 2025 14:42
Show Gist options
  • Save renatogroffe/9f1e56aac9373963f42841c6e08056a5 to your computer and use it in GitHub Desktop.
Save renatogroffe/9f1e56aac9373963f42841c6e08056a5 to your computer and use it in GitHub Desktop.
using System.Runtime.CompilerServices;
namespace ConsoleAppOverloadResolution.Tests;
public class OverloadResolutionPriorityTester
{
[OverloadResolutionPriority(1)]
public static void PrintItems(params string[] items)
=> Console.WriteLine($"{nameof(OverloadResolutionPriorityTester)} - " +
$"string[]: [ {String.Join(" | ", items)} ]");
[OverloadResolutionPriority(2)]
public static void PrintItems(params ReadOnlySpan<string?> items)
=> Console.WriteLine($"{nameof(OverloadResolutionPriorityTester)} - " +
$"ReadOnlySpan<string?>: [ {String.Join(" | ", items)} ]");
[OverloadResolutionPriority(3)]
public static void PrintItems(params IEnumerable<string> items)
=> Console.WriteLine($"{nameof(OverloadResolutionPriorityTester)} - " +
$"IEnumerable<string>: [ {String.Join(" | ", items)} ]");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment