Skip to content

Commit c70f76d

Browse files
authored
Merge pull request #11851 from Calinou/gdscript-static-typing-fix-example
Fix dictionary static typing `for` loop code sample in Static typing in GDScript
2 parents bd3b339 + 8236543 commit c70f76d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials/scripting/gdscript/static_typing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ and custom classes, and enums may be used as element types. Nested typed collect
274274
var dictionary_of_dictionaries: Dictionary[String, Dictionary] = { { } }
275275
# var dicts: Dictionary[String, Dictionary[String, int]] -- disallowed
276276

277-
for cost in fruit_costs:
278-
# cost has type `int`
277+
for fruit in fruit_costs:
278+
# `fruit` has type `String`
279279

280280
# The following would be errors:
281281
fruit_costs["pear"] += vehicles

0 commit comments

Comments
 (0)