Godot Version
4.4dev3
During coding I accidentally found of keywords ‘when’ and ‘trait’ but I сouldn’t find usage examples with these keywords. Can anyone show a code or situations where it can be used?
4.4dev3
During coding I accidentally found of keywords ‘when’ and ‘trait’ but I сouldn’t find usage examples with these keywords. Can anyone show a code or situations where it can be used?
The when keyword can be used during match statement to configure extra arguments i believe
I tried for test and it worked, thank you.
match self.name:
'Main' when self.name is StringName:print('OK')
But what for trait? Seems like it is the same level keyword as “extends”
Havent been able to figure it out yet
Seems like it just a reserved word for possible ‘trait’ system implemented in Godot. You helped to me with ‘when’ I’ll mark it as solution
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.