Created
January 6, 2025 14:42
-
-
Save renatogroffe/9f1e56aac9373963f42841c6e08056a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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