C# Method Resolution, long vs int
The int version of bar is being called, because 10 is an int literal and the compiler will look for the method which closest matches the input variable(s). To call the long version, you’ll need to specify a long literal like so: foo.bar(10L); Here is a post by Eric Lippert on much more complicated versions …