Godot: GDScript: duplicate keys in dictionary is parsed without error

Created on 6 Aug 2020  路  3Comments  路  Source: godotengine/godot

Godot version: v4.0.dev.custom_build 35ff38b3d

OS/device including version: windows 10

Issue description:

func _ready():
    var d = {
        "duplicate_key": 1,
        "duplicate_key": 2, ## <-- this should be invalid
    }
    print(d)
bug regression gdscript

Most helpful comment

FYI current message is now this: Parse Error: Key "duplicate_key" was already used in this dictionary (at line 5).

All 3 comments

In comparison, 3.2.2 will mark an error about "Duplicate key found in Dictionary literal".

By the way, it would be nice if the key name in question was mentioned in the error message.

This was fixed by #41381

FYI current message is now this: Parse Error: Key "duplicate_key" was already used in this dictionary (at line 5).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  161Comments

crystalnoir picture crystalnoir  路  145Comments

ghost picture ghost  路  105Comments

RyanBram picture RyanBram  路  101Comments

zatherz picture zatherz  路  121Comments