Skip to content

Instantly share code, notes, and snippets.

@SLaks
Last active August 29, 2015 13:56
Show Gist options
  • Save SLaks/9008021 to your computer and use it in GitHub Desktop.
Save SLaks/9008021 to your computer and use it in GitHub Desktop.
RQName Inconsistency
void M<X, Y>(X a, Y b) { }
void M<Y, X>(X a, Y b) { }
//Meth(Agg(AggName(S,TypeVarCnt(0))),MethName(M),TypeVarCnt(2),Params(Param(TyVar(X)),Param(TyVar(Y))))
//Meth(Agg(AggName(S,TypeVarCnt(0))),MethName(M),TypeVarCnt(2),Params(Param(TyVar(X)),Param(TyVar(Y))))
//M:S.M``2(``0,``1)
//M:S.M``2(``1,``0)
class X<T1>
{
public void Y<T2>(Func<T1, T2> f) { }
public void Y<T2>(Func<T2, T1> f) { }
}
new X<int>().Y<string>((string x) => 0);
new X<int>().Y<string>((int x) => "");
//Meth(Agg(AggName(X,TypeVarCnt(1))),MethName(Y),TypeVarCnt(1),Params(Param(AggType(Agg(NsName(System),AggName(Func,TypeVarCnt(2))),TypeParams(TyVar(T2),TyVar(T1))))))
//M:X`1.Y``1(System.Func{``0,`0})
//Meth(Agg(AggName(X,TypeVarCnt(1))),MethName(Y),TypeVarCnt(1),Params(Param(AggType(Agg(NsName(System),AggName(Func,TypeVarCnt(2))),TypeParams(TyVar(T1),TyVar(T2))))))
//M:X`1.Y``1(System.Func{`0,``0})
// How can I figure out which is which, from native lang services only?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment