14.05.2015, 17:41
(
Последний раз редактировалось Yashas; 14.05.2015 в 17:43.
Причина: Stupid Smilies!!!
)
Using tagof(_: ) crashes the compiler.
Is this by any chance a compiler bug?Or I just don't know how to check if a variable is tagless.
Compiling this code won't give any warning.Moreover it gives the wrong output when executed.
b is tagless and the compiler is supposed to issue me a warning for tag mismatch but it doesn't.On top of that, when the code is executed.It says "Float Float".How is a tagless variable having a Float tag?
Is this by any chance a compiler bug?Or I just don't know how to check if a variable is tagless.
Compiling this code won't give any warning.Moreover it gives the wrong output when executed.
Код:
new Float:a=123.2,b =5; MyFunc(a,b);
Код:
stock MyFunc({Float,bool}:var1,{Float,bool}:var2,tagid1 = tagof(var1),tagid2 = tagof(var2))
{
if(tagid1 == tagof(Float:))
{
if(tagid2 == tagof(Float:))
{
print("Float Float");
}
else if(tagid2 == tagof(bool:))
{
print("Float Bool");
}
else
{
print("Ahhh...you are a bad programmer.You ignored the compiler's tag mismatch warning!!!");
}
}
else if(tagid1 == tagof(bool:))
{
if(tagid2 == tagof(Float:))
{
print("Bool Float");
}
else if(tagid2 == tagof(bool:))
{
print("Bool Bool");
}
else
{
print("Ahhh...you are a bad programmer.You ignored the compiler's tag mismatch warning!!!");
}
}
else
{
print("Ahhh...you are a bad programmer.You ignored the compiler's tag mismatch warning!!!");
}
}

