![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Krasapan |
var save = File.new()
and
var save := File.new()
What’s the difference? As for me, they works alike
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Krasapan |
var save = File.new()
and
var save := File.new()
What’s the difference? As for me, they works alike
![]() |
Reply From: | ichster |
:=
implicitly sets the type of the variant to that of the assigned value. In this instance, the variant save
would become type File
when using :=
, and directly inferred as such by the compiler. When using just =
I think the type of save
remains a variant.
A duplicate and more nuanced version of this question is here: https://forum.godotengine.org/85433/difference-between-equals-and-colon-equals