Argument count mismatch on assert function?

I think this is a bug in Studio, and I don’t have access to report bugs. I spend 10 hours a day in studio, everyday, and think I might just start posting my bug reports here.

I’m trying to get rid of all warnings and errors in my game before release. I’m not sure if this warning can be fixed easily unless I override the current assert function or make my own.

for example I have

 assert(#points >= 3, "Must have at least 3 points")

and I get a warning in the script analysis window of studio - “Argument count mismatch. Function expects 1 argument, but 2 are specified”

And this is happening on ALL asserts now - ones I didn’t even create, but were in library script I use for bezier curves, written by Crazyman32.

So far it seems like the script works, anyway, and this is just a warning, but I’d like to get rid of all these warnings… I suppose I could comment out all Crazyman32’s asserts, for now…

Yea, I’m sure this is an engine bug.

2 Likes

Yes, because I know the assert function commonly gets 2 arguments. Seen it done hundreds of times.

Yea as @HugeCoolboy2007 this is definitely a bug, you’d definitely have to make your own assert function for the time being until word goes around that the warning is fixed, here’s how you could do it

if #points < 3 then error("Must have at least 3 points") end
1 Like