Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdscript -> Assign a boolean value to a typed float produces no error. #26248

Open
Ranoller opened this issue Feb 24, 2019 · 3 comments · May be fixed by #40336
Open

Gdscript -> Assign a boolean value to a typed float produces no error. #26248

Ranoller opened this issue Feb 24, 2019 · 3 comments · May be fixed by #40336

Comments

@Ranoller
Copy link
Contributor

Godot version:

5e837b3

OS/device including version:

win 7

Issue description:

This expresion:

export (bool) var UseAceleration : float = false

Produces no error: no error in the declaration nor in the logic... godot ignores the value entered in inspector and cast false to 0.

The expected result is godot advice to you that entered value doesn´t match the type.

@Anutrix
Copy link
Contributor

Anutrix commented Feb 28, 2024

I thought this might have been close since we refactored into new GDScript but the bug still seems to be there in a way.
No error or warning is seen for:

@export var number: bool = 5

when there should at least be a warning.

@AThousandShips
Copy link
Member

The issue here was assigning a boolean to a float, not the other way around though, they might very well be different, casting from a non-boolean to a boolean is AFAIK a valid use, the other way around might be something to warn about though

@KoBeWi
Copy link
Member

KoBeWi commented Nov 16, 2024

Related: #40249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants