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

Error creating a property in inner class #91216

Open
Torguen opened this issue Apr 26, 2024 · 4 comments · May be fixed by #91506
Open

Error creating a property in inner class #91216

Torguen opened this issue Apr 26, 2024 · 4 comments · May be fixed by #91506

Comments

@Torguen
Copy link

Torguen commented Apr 26, 2024

Tested versions

v4.3.dev5.official [89f70e9]

System information

w10 64

Issue description

When a property is created in an inner class this error is generated., I think it is a bug, because I believe that this error should not happen.

Captura5

Captura6

Steps to reproduce

Create a property in an inner class

Minimal reproduction project (MRP)

...

@Torguen Torguen changed the title Error not coming in inner class Error creating a property in inner class Apr 26, 2024
@AThousandShips
Copy link
Member

AThousandShips commented Apr 26, 2024

The, issue is that the error isn't clear, but the proper syntax is:

var dir_horizontal: int:
    set(...)

@AThousandShips
Copy link
Member

I'd suspect it's not easy to detect this error clearly though, as you can't quite assume that this is missing

Does it print a different error when not in an inner class?

CC @dalexeev @vnen

@Torguen
Copy link
Author

Torguen commented Apr 26, 2024

I'd suspect it's not easy to detect this error clearly though, as you can't quite assume that this is missing

Does it print a different error when not in an inner class?

CC @dalexeev @vnen

Print the same error

Captura5

@dalexeev
Copy link
Member

I'd suspect it's not easy to detect this error clearly though, as you can't quite assume that this is missing

I think it's pretty simple, just check the INDENT token where we expect a colon. I'll look at this later.

ArchieVillain added a commit to ArchieVillain/godot that referenced this issue May 3, 2024
It's quite easy for users to forget to use the colon before their
setters and getters, but in this situation error messages are unclear about
the real nature of the problem.

This commit adds a check for malformed set/get statements and provides
error messages containing more direct guidance to users.

Closes godotengine#91216
ArchieVillain added a commit to ArchieVillain/godot that referenced this issue May 3, 2024
It's quite easy for users to forget to use the colon before their
setters and getters, but in this situation error messages are unclear about
the real nature of the problem.

This commit adds a check for malformed set/get statements and provides
error messages containing more direct guidance to users.

Closes godotengine#91216
ArchieVillain added a commit to ArchieVillain/godot that referenced this issue May 3, 2024
It's quite easy for users to forget to use the colon before their
setters and getters, but in this situation error messages are unclear about
the real nature of the problem.

This commit adds a check for malformed set/get statements and provides
error messages containing more direct guidance to users.

Closes godotengine#91216
ArchieVillain added a commit to ArchieVillain/godot that referenced this issue May 3, 2024
It's quite easy for users to forget to use the colon before their
setters and getters, but in this situation error messages are unclear about
the real nature of the problem.

This commit adds a check for malformed set/get statements and provides
error messages containing more direct guidance to users.

Closes godotengine#91216
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.

3 participants