Skip to content

Commit 40cdc10

Browse files
Improved test to demonstrate overload resolution
1 parent a14b22d commit 40cdc10

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/Serilog.Settings.Configuration.Tests/Support/StaticAccessorClasses.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,7 @@ public class ClassWithStaticAccessors
5656
public static Func<string, int> FuncIntParseProperty => int.Parse;
5757
public static NamedIntParse NamedIntParseProperty => int.Parse;
5858
public static int IntParseMethod(string value) => int.Parse(value);
59+
public static int IntParseMethod(string value, string otherValue) => int.Parse(value); // will not be chosen, extra parameter
60+
public static int IntParseMethod(object value) => throw new NotImplementedException(); // will not be chosen, wrong parameter type
5961
}
6062
}

0 commit comments

Comments
 (0)