Skip to content

Commit 7c5c911

Browse files
add test
1 parent 6f5559b commit 7c5c911

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

unittests/CppInterOp/FunctionReflectionTest.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,26 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) {
18241824

18251825
auto fn_callable = Cpp::MakeFunctionCallable(fn);
18261826
EXPECT_EQ(fn_callable.getKind(), Cpp::JitCall::kGenericCall);
1827+
1828+
Interp->process(R"(
1829+
template <typename T>
1830+
bool call_move(T&& t) {
1831+
return true;
1832+
}
1833+
)");
1834+
1835+
unresolved_candidate_methods.clear();
1836+
Cpp::GetClassTemplatedMethods("call_move", Cpp::GetGlobalScope(),
1837+
unresolved_candidate_methods);
1838+
EXPECT_EQ(unresolved_candidate_methods.size(), 1);
1839+
1840+
Cpp::TCppScope_t call_move = Cpp::BestOverloadFunctionMatch(
1841+
unresolved_candidate_methods, {},
1842+
{Cpp::GetReferencedType(Cpp::GetType("int"), true)});
1843+
EXPECT_TRUE(call_move);
1844+
1845+
auto call_move_callable = Cpp::MakeFunctionCallable(call_move);
1846+
EXPECT_EQ(call_move_callable.getKind(), Cpp::JitCall::kGenericCall);
18271847
}
18281848

18291849
TEST(FunctionReflectionTest, IsConstMethod) {

0 commit comments

Comments
 (0)