As I know Expression trees is immutable so why compiler didn't use same object reference for a static expression, like string literals?
To clarify the question please see the example:
static void Main(string[] args)
{
Test(p => true);//2637164
Test(p => true);//3888474
Test("true");//-292522067
Test("true");//-292522067
Console.ReadKey();
}
public static void Test(Expression<Func<string,bool>> exp)
{
Console.WriteLine(exp.GetHashCode());
}
public static void Test(string str)
{
Console.WriteLine(str.GetHashCode());
}