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

Godot shows an error in console if you're using C# 10 feature "File-Scoped namespaces" (ERROR: Failed to determine namespace and class for script) #61485

Closed
valkyrienyanko opened this issue May 28, 2022 · 1 comment

Comments

@valkyrienyanko
Copy link

valkyrienyanko commented May 28, 2022

Godot version

3.4.4.stable.mono

System information

Windows 10 64-bit

Issue description

C# 10.0 added a new feature "File scoped namespaces"

If you try to use this feature you will get a error that will flash before your eyes just before the game is done building but you can see the error clearly in VSCode console. (I opened Godot through VSCode)

ERROR: Failed to determine namespace and class for script: res://Scripts/UI/Inventory/ControlInventory.cs. 
Parse error: Unexpected token: Symbol

image

The game seems to run fine. The error is the only annoying thing to see everything the game is started.

Having file-scoped namespaces would make scripts alot easier to read.

Steps to reproduce

Convert any namespace in any script to a file-scoped namespace. Notice the error in the console just before game start.

With file-scoped namespace
image

Without file-scoped namespace
image

Minimal reproduction project

No response

@raulsntos
Copy link
Member

Fixed by #56427

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

No branches or pull requests

2 participants