template <typename T>
T add3(T a, T b)
{
// #TEST#: EXF19 Extract Function on expression
// #TEST#: EXF20 Extract Function on statement
return a + b;
}
EXF19 and EXF20 fail and introduce invalid code:
T MyMethod(T a, T b)
{
return a + b;
}
template <typename T>
T add3(T a, T b)
{
// #TEST#: EXF19 Extract Function on expression
// #TEST#: EXF20 Extract Function on statement
return MyMethod(a, b);
}
The type of the values in the expression are template types and therefore the extracted function needs to be a template function.