match_bind_unused.gd 314 B

12345678910111213
  1. # https://github.com/godotengine/godot/pull/61666
  2. func test():
  3. var dict := {"key": "value"}
  4. match dict:
  5. {"key": var value}:
  6. print(value) # used, no warning
  7. match dict:
  8. {"key": var value}:
  9. pass # unused, warning
  10. match dict:
  11. {"key": var _value}:
  12. pass # unused, suppressed warning from underscore