Repository: godotengine/godot (language: cpp)

Issue:
`Dictionary::has` doesn't use validated key
### Tested versions

v4.5.dev.custom_build [4248411ba]

### System information

Godot v4.5.dev (4248411ba) - Windows 10 (build 19045) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (Advanced Micro Devices, Inc.; 32.0.12033.1030) - 12th Gen Intel(R) Core(TM) i3-12100F (8 threads)

### Issue description

When `Dictionary` validates the key type passed in, the type may be changed to match the container type.  In most cases, the validated type is used, but `Dictionary::has` uses the original passed in type, which may cause it to not find the key in the `HashMap`.  I think this only impacts dictionaries with `float` keys, when calling `has` with an `int` - `String`/`StringName` differences seem to be handled by `StringLikeVariantComparator`.

Example gdscript:

```gdscript
func _ready() -> void:
	var d : Dictionary[float, String] = {}
	d[1] = "value"
	print(d.has(1))
	print(d.has_all([1]))
	print(d[1])
	print(d)
```

Output:
```
false
true
value
{ 1.0: "value" }
```

Expected:
```
true
true
value
{ 1.0: "value" }
```

### Steps to reproduce

Create a `Dictionary` with `float` key type, add a whole number key, then call `has` with the key as an `int`

### Minimal reproduction project (MRP)

N/A, can be reproduced in new project with gdscript above


Discussion / hints:

Fix patch:
diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp
index 6d89e3a1aed3..48164e30bde0 100644
--- a/core/variant/dictionary.cpp
+++ b/core/variant/dictionary.cpp
@@ -218,7 +218,7 @@ bool Dictionary::is_empty() const {
 bool Dictionary::has(const Variant &p_key) const {
 	Variant key = p_key;
 	ERR_FAIL_COND_V(!_p->typed_key.validate(key, "use 'has'"), false);
-	return _p->variant_map.has(p_key);
+	return _p->variant_map.has(key);
 }
 
 bool Dictionary::has_all(const Array &p_keys) const {


Test patch: