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

Parser bug: Trying to check compatibility of unset value type when setting modulate to a Color constant #50313

Closed
EIREXE opened this issue Jul 9, 2021 · 3 comments · Fixed by #53715
Assignees
Milestone

Comments

@EIREXE
Copy link
Contributor

EIREXE commented Jul 9, 2021

Godot version

4.0.dev (d4e5fe6)

System information

Windows 11, GLES3

Issue description

extends Area2D

class_name HookPoint

var active := false:
	set(val):
		active = val
		modulate = Color.RED if active else Color.WHITE

If the color constants are replaced by non-constant color (such as Color("#FF0000")) the error disappears.
The editor doesn't complain about this error, it only appears at runtime.
The debugger also shows the error "Identifier not found: Color"

Steps to reproduce

Use the script above, observe the stated error in the console

Minimal reproduction project

No response

@nonunknown
Copy link
Contributor

Can you post the error message shown by console? I had this issue with almost any script I create!

@HaSa1002
Copy link
Contributor

HaSa1002 commented Jul 9, 2021

The color constants are capitalized now.
So you should write:

extends Area2D

class_name HookPoint

var active := false:
	set(val):
		active = val
		modulate = Color.RED if active else Color.WHITE

@EIREXE
Copy link
Contributor Author

EIREXE commented Jul 9, 2021

The color constants are capitalized now.
So you should write:

extends Area2D

class_name HookPoint

var active := false:
	set(val):
		active = val
		modulate = Color.RED if active else Color.WHITE

I mistyped it, it happens with the color constants capitalized.
It's also not related to ternary operators, as it happens without them too.

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.

5 participants