Skip to content

Commit

Permalink
Add test for type unification with the same generic type multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
exyi committed Jan 17, 2024
1 parent de18fe0 commit dce2157
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/Framework/Framework/Utils/ReflectionUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ internal static bool TryUnifyGenericTypes(Type a, Type b, Dictionary<Type, Type>

internal static void ExpandUnifiedTypes(Dictionary<Type, Type> genericAssignment)
{
// var dirty = true;
var iteration = 0;
bool dirty;
do
Expand Down
9 changes: 0 additions & 9 deletions src/Tests/Binding/BindingCompilationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,6 @@ public void BindingCompiler_Valid_LambdaParameter_PreferFunc(string expr)
[DataRow("DelegateInvoker2('string', (i, a) => StringProp = (i + a))", "with int", "0string")]
public void BindingCompiler_Valid_LambdaParameter_TypeFromOtherArg(string expr, string expectedResult, string stringPropResult)
{
// while(!Debugger.IsAttached)
// {
// System.Threading.Thread.Sleep(100);
// }

var viewModel = new TestLambdaCompilation();
var result = ExecuteBinding(expr, viewModel);
Assert.AreEqual(expectedResult, result, message: "Result mismatch");
Expand Down Expand Up @@ -499,10 +494,6 @@ public void BindingCompiler_Valid_LambdaParameter_CombinedTypeModifies(string ex
[DataRow("_this.CustomGenericDelegateInvoker(true, as => as.Select(a => !a))", "False,False")]
public void BindingCompiler_Valid_LambdaParameter_CustomDelegate(string expr, string expectedResult)
{
// while(!Debugger.IsAttached)
// {
// System.Threading.Thread.Sleep(100);
// }
var viewModel = new TestLambdaCompilation();
var result = ExecuteBinding(expr, viewModel);
Assert.AreEqual(expectedResult, result);
Expand Down
3 changes: 3 additions & 0 deletions src/Tests/Runtime/ReflectionUtilsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public string GetDisplayName(MethodInfo methodInfo, object[] data) =>
public void Test0<T>(T a, string b, string expected) { }
public void Test1<T>(List<T> a, List<string> b, string expected) { }
public void Test2<T, U>(Func<T, string> a, Func<int, U> b, int expected, string expected2) { }
public void TestTypeUsedMultipleTime0<T>(Func<Func<int>> a, Func<T> b, Func<int> expected) { }
public void TestTypeUsedMultipleTime1<T>(Func<Func<int>> a, Func<Func<T>> b, int expected) { }
public void TestTypeUsedMultipleTime2<T, U>((IEnumerable<T>, IEnumerable<(int, int)>) a, (IEnumerable<IEnumerable<int>>, IEnumerable<U>) b, IEnumerable<int> expected, (int, int) expected2) { }
public void TestPartial0<T>(T a, T b, T expected) { }
public void TestPartial1<T, U>(Func<string, T> a, Func<U, T> b, T expected, string expected2) { }
public void TestPartial2<T, U>(Tuple<T, string> a, U b, T expected, Tuple<T, string> expected2) { }
Expand Down

0 comments on commit dce2157

Please sign in to comment.