Here is demonstration of the problem:

```
class Program
{
    static double Func(double a, double b) { return a * 1000 + b * b; }

    static void Main(string[] args)
    {
        var a = 1.1d;
        var b = 2.2d;
        Console.WriteLine(Func(a, b));
        // this is the problem, function doesn't recognize when a and b
        // "accidentally" exchanged, target is to make this row a compile-time error
        Console.WriteLine(Func(b, a));
    }
}

```

This become an issue if there are methods with many parameters (e.g. ten of `double` type):

```
double Func(double parameter1, double parameter2, ..., double parameter10);

```

Question: is there a way to validate parameters when calling method, so that programmer is less prone to do a mistake?

---

This is not an issue if parameter types are different. I thought what maybe *wrapping* into new types will help:

```
class A
{
    private double _value;
    public static implicit operator A(double value) { return new A() { _value = value }; }
    public static implicit operator double(A value) { return value._value; }
}
class B
{
    private double _value;
    public static implicit operator B(double value) { return new B() { _value = value }; }
    public static implicit operator double(B value) { return value._value; }
}

class Program
{
    static double Func(A a, B b) { return a * 1000 + b * b; }

    static void Main(string[] args)
    {
        A a = 1.1d;
        B b = 2.2d;
        Console.WriteLine(Func(a, b));
        Console.WriteLine(Func(b, a)); // compile-time error! yay!
        Console.WriteLine(Func(a, b) + 123.123d - a * 2); // implicit conversion power
        Console.ReadKey();
    }
}

```

And it does, but I am quite unsure if this method is efficient. I have doubts if this is a good idea at all. Is it? Or is there better one?

I know what I can be absolutely safe if I always call method like this (using [named arguments](https://msdn.microsoft.com/en-us/library/dd264739.aspx) method call)

```
Func(a:a, b:b);

```

This shouldn't bring any overhead in code, but a lot of typing. Wrapping is better because it is done once (creating new type is easy), but it probably has overhead.