Assert function is broken

Basically the title. When using the assert function I get a warning:

“W000: Argument count mismatch. Function expects 1 argument, but 2 are specified.”


Was there an update I'm unaware of?

You have 2 arguments instead of 1

You need to remove the INITIALIZED or Print

What is INITIALIZED defined as? You might need to implement a conditional check perhaps?

According to documentation, the assert() function has 2 arguments. So this could be a bug, I’m not sure. Have you restarted studio? Also, what have you defined your first variable as?

I know. Assert is normally supposed to take two arguments, an evaluation, and a string that is outputted if the evaluation is false.

May be a bug then no way they would update it and not tell us, studio has been bugging for a while now

I’ve restarted studio and the warning still appears.

I’ve declared the INITIALIZED variable at the top of the script.

image

Then it’s safe to say it must be a bug. Hopefully this will be fixed but in the meantime you could try making your own function to mimic the assert() function.

2 Likes