rsdn/nemerle — Issue #221: Type cust operators turn in conventional methods
Author: VladD2
Created: 2012-01-01 12:41:32+00:00
State: open
Labels: Bug, C# support

```csharp
public struct NameOrIndexParameter
{
public NameOrIndexParameter(string _name) { }
public NameOrIndexParameter(int _index) { }

public static implicit operator NameOrIndexParameter(string name)
{
return new NameOrIndexParameter(name);
}

public static implicit operator NameOrIndexParameter(int index)
{
return new NameOrIndexParameter(index);
}
}

public class Program
{
static void Test(NameOrIndexParameter _x) { } // E: in argument #1 (_x), needed a LinqToDB.Common.NameOrIndexParameter, got string
static void Main() { Test("a"); }
}
```