You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class MyClass {
public void Foo(string x){ }
public void Foo(int x){ }
public void Foo(SomeCrazyTypeFromAThirdPartyAssembly x){ }
}
If I want to call Foo("asdf"), the calling class has to have a reference to SomeCrazyTypeFromAThirdPartyAssembly even though I have no intention of using it. Can this restriction be removed? It should only consider types that the calling assembly references.
The text was updated successfully, but these errors were encountered:
No, this restriction cannot be removed. At a fundamental level we have to know what all the types involved mean, because that other type could actually cause an ambiguity or it might end up being a better match. For example:
Let's say I have the following Methods:
If I want to call Foo("asdf"), the calling class has to have a reference to SomeCrazyTypeFromAThirdPartyAssembly even though I have no intention of using it. Can this restriction be removed? It should only consider types that the calling assembly references.
The text was updated successfully, but these errors were encountered: