411 REFERENCE · Wikibooks
Guide to the Godot game engine/Programming/GDScript/Static typing
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Static typing
Many programming languages are static. For GDScript, it's entirely optional. Here you will learn how to make your code safer and use static typing.
Staticly typed functions
Do not confuse this for static functions.
->void tells Godot the function returns nothing.
-> <type> tells Godot that the function returns <type>. This can be any Object, or any variable type.
Use nothing to hint the function can return anything.
Arguments can also be made static: argument: <type>
Statically typed variables
var variable: <type> = <something or null> simple. That's it.
You can also use var variable := <something> to automatically use whatever "something" is.