@@ -2193,3 +2193,31 @@ TEST(FunctionReflectionTest, UndoTest) {
21932193#endif
21942194#endif
21952195}
2196+
2197+ TEST (FunctionReflectionTest, FailingTest1) {
2198+ Cpp::CreateInterpreter ();
2199+ EXPECT_FALSE (Cpp::Declare (R"(
2200+ class WithOutEqualOp1 {};
2201+ class WithOutEqualOp2 {};
2202+
2203+ WithOutEqualOp1 o1;
2204+ WithOutEqualOp2 o2;
2205+
2206+ template<class C1, class C2>
2207+ bool is_equal(const C1& c1, const C2& c2) { return (bool)(c1 == c2); }
2208+ )" ));
2209+
2210+ Cpp::TCppType_t o1 = Cpp::GetTypeFromScope (Cpp::GetNamed (" o1" ));
2211+ Cpp::TCppType_t o2 = Cpp::GetTypeFromScope (Cpp::GetNamed (" o2" ));
2212+ std::vector<Cpp::TCppFunction_t> fns;
2213+ Cpp::GetClassTemplatedMethods (" is_equal" , Cpp::GetGlobalScope (), fns);
2214+ EXPECT_EQ (fns.size (), 1 );
2215+
2216+ Cpp::TCppScope_t fn = Cpp::BestOverloadFunctionMatch (fns, {}, {o1, o2});
2217+ EXPECT_TRUE (fn);
2218+ Cpp::JitCall jit_call = Cpp::MakeFunctionCallable (fn);
2219+ EXPECT_EQ (jit_call.getKind (), Cpp::JitCall::kUnknown ); // expected to fail
2220+ EXPECT_FALSE (Cpp::Declare (" int x = 1;" )); // expected to pass, but fails
2221+ EXPECT_FALSE (Cpp::Declare (
2222+ " int y = 1;" )); // expected to pass, and passes on second attempt
2223+ }
0 commit comments