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

Default case in .gdshaderinc must be defined at end of scope, but not in 4.3 #103174

Open
Murrent opened this issue Feb 22, 2025 · 0 comments · May be fixed by #103177
Open

Default case in .gdshaderinc must be defined at end of scope, but not in 4.3 #103174

Murrent opened this issue Feb 22, 2025 · 0 comments · May be fixed by #103177

Comments

@Murrent
Copy link

Murrent commented Feb 22, 2025

Tested versions

Error thrown in Godot v4.4.rc1
No error in Godot v4.3-stable

System information

Godot v4.4.rc1 - Windows 11 (build 26100) - Multi-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 (NVIDIA; 32.0.15.7242) - AMD Ryzen 7 3700X 8-Core Processor (16 threads)

Issue description

A .gdshaderinc with a default case at the top of the scope in a switch statement throws an error in Godot 4.4 RC 1. But not in 4.3.
Error: Cases must be defined before default case.

Maybe this is the intended behavior, but it does make the transition from previous versions more difficult.

Steps to reproduce

  1. Create an empty project.
  2. Add a file test.gdshaderinc
  3. Open the file and paste this code:
void test() {
	switch (0) {
		default:
			break;
		case 0:
			break;
	};
}

Minimal reproduction project (MRP)

switch_4_3_stable.zip

switch_4_4_rc1.zip

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

Successfully merging a pull request may close this issue.

1 participant