Repository: godot
Issue: Float properties of custom resources using int-returning getters are loaded incorrectly, and viceversa.
Labels: bug,topic:core,topic:gdscript

### Godot version

v4.1.3.stable.official [f06b6836a]

### System information
`
Godot v4.1.3.stable - Manjaro Linux #1 SMP PREEMPT Sat Sep 23 10:10:02 UTC 2023 - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 550 / 550 Series (RADV POLARIS12) () - AMD Ryzen 5 3600 6-Core Processor (12 Threads)`

### Issue description

GDscript allows assigning int-returning getters to float properties, apparently relying on implicit casts. If you do this with a custom Resource class, however, you run into problems: when you load the resource the value of the property returns 0 unless you explicitly call the getter, and no error or warning appears anywhere.

If you do it the other way around (define a property as int but assign a float-returning getter) you do get a warning, but the property is still loaded incorrectly.

I suggest getters and setters should always match the type of the properties they are assigned to, even if an implicit cast exists. Otherwise it is easy to run into errors when you define a variable and its accessors as integer but then change it to float and forget to update the type of the getter (as was my case).

### Steps to reproduce

1. Create a class inheriting from Resource. 
2. Create a property defined as float.
3. Assign to it a getter that returns int. 
4. Instance one such resource.
5. Assign a non-zero value to the float property.
6. Save the resource
7. Load the resource
8. The value of the property is 0 unless you get it by explicitly calling the getter.

If you do it the other way around (define a property as int but assign a float-returning getter) you do get a warning, but the property is loaded as a big number like 4621819117588971520, which I assume is the binary representation of the float value being interpreted as an integer.

I'm attaching a MRP, but since it's so brief I'll include the code here as well for ease of reading.

This is the custom resource class with the mismatched properties and getters:

```
class_name CustomResource
extends Resource

@export var something:float = 10 : get = get_something
@export var something_else:int = 10 : get = get_something_else

func get_something()->int:
	return something
	
func get_something_else()->float:
	return something_else
```

If you run this code:

```
	var new_resource = CustomResource.new()
	new_resource.something = int(137)
	new_resource.something_else = float(3.1416)
	ResourceSaver.save(new_resource, "res://saved_res.tres")
	
	print("Before saving the resource:")
	print("\tThe value of something is %s" % new_resource.something)
	print("\tThe value of get_something() is %s" % new_resource.get_something())
	print("\tThe value of something_else is %s" % new_resource.something_else)
	print("\tThe value of get_something_else() is %s" % new_resource.get_something_else())
	
	var loaded_resource:CustomResource = ResourceLoader.load("res://saved_res.tres")
	
	print("After saving the resource:")
	print("\tThe value of something is %s" % loaded_resource.something)
	print("\tThe value of get_something() is %s" % loaded_resource.get_something())
	print("\tThe value of something_else is %s" % loaded_resource.something_else)
	print("\tThe value of get_something_else() is %s" % loaded_resource.get_something_else())
```

You get this:

```
Before saving the resource:
	The value of something is 137
	The value of get_something() is 137
	The value of something_else is 3
	The value of get_something_else() is 3
After saving the resource:
	The value of something is 0
	The value of get_something() is 137
	The value of something_else is 4613937818241073152
	The value of get_something_else() is 3
```


### Minimal reproduction project

[WrongGetterTypeTest.zip](https://github.com/godotengine/godot/files/13236800/WrongGetterTypeTest.zip)