learn-gdscript icon indicating copy to clipboard operation
learn-gdscript copied to clipboard

Lesson 25.2: Crashes when I use assertions (assert())

Open Songbird0 opened this issue 3 years ago • 0 comments

Describe the bug I just added two assertions in my code for exhaustiveness and editor printed this error:

Oh no! The script has an error, but the Script Verifier did not catch it

To Reproduce

Run this code:

func add_item(item_name, amount):
	assert(!item_name.empty())
	assert(amount > 0)
	inventory[item_name] += amount

Expected behavior I expected no error raised

For more informations, have a look at this log file.

Songbird0 avatar Dec 20 '22 22:12 Songbird0