learn-gdscript icon indicating copy to clipboard operation
learn-gdscript copied to clipboard

Lesson 27, practice 2 doesn't actually differentiate between ints and floats

Open jman904 opened this issue 1 year ago • 1 comments

the following solution still passes all the checks (probably due to dynamic casting):


var whole_number: int = 4.1
var text: String = "Hello, world!"
var vector: Vector2 = Vector2(1, 1)
var decimal_number: float = 3

jman904 avatar Aug 24 '24 18:08 jman904

That's a good catch :)

Thanks for taking the time to open issues. The Godot 3 type checker doesn't error on that. We've cheated a bunch in practice checks in this app. Here, we'd need to do some minimal parsing of the code to make it robust.

NathanLovato avatar Aug 24 '24 20:08 NathanLovato