tagof(_:) crashes the compiler and a potential compiler bug or I am bugged - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: tagof(_:) crashes the compiler and a potential compiler bug or I am bugged (
/showthread.php?tid=574207)
tagof(_:) crashes the compiler and a potential compiler bug or I am bugged -
Yashas - 14.05.2015
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.
Код:
new Float:a=123.2,b =5;
MyFunc(a,b);
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?
Код:
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!!!");
}
}
Re: tagof(_:) crashes the compiler and a potential compiler bug or I am bugged -
Konstantinos - 14.05.2015
Swap the tags.
pawn Код:
MyFunc({bool,Float}:var1,{bool,Float}:var2,tagid1 = tagof(var1),tagid2 = tagof(var2))