When trying to compile a code like this:
The compiler says: error: indirect call is not allowed inside routine.
Whereas if a variable is used to hold the results of the first function call:
Class2 class2 = Class1::getInstance()->getClass2();
The compiler will not give any error. Why does the compiler work this way? Is there any way of overriding this behavior?
Thanks a lot, and greetings,