Forum:Template Loop warning occured when calling only a sub-template !

At first, I created a template called msgbox, then some sub-templates, e.g. msgbox/spoiler, by feeding certain parameters into msgbox. Later I redirected another template, say, message-box, to the previous one msgbox. Codes like work well: parameters are also redirected to msgbox. I also hoped that would behave the same way as , but that won't work. So I googled and found a solution in Variable_templates. I added one more parameter into msgbox: #if: then call, else do what it previously did. This time when I wrote, a Template Loop Detected warning was raised. Do the system consider the same page as  ?? But then, I created a testing template test2: #if: then call, else print something else. Strange, when I put the line before , the warning disappeared!! Somebody can explain that for me?? BTW, a minimal example on my wiki (zh.madoka.wikia.com): Template:test, Template:test/x, Template:test/y, Template:test2, and the sandbox http://zh.madoka.wikia.com/wiki/%E6%B2%99%E7%9B%92