godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.41k stars 21.26k forks source link

Having a variable named `value` causes a source generator error 4.0 beta5 #68746

Closed cphillips83 closed 2 years ago

cphillips83 commented 2 years ago

Godot version

4.0.beta5

System information

Windows 11

Issue description

Godot.SourceGenerators\Godot.SourceGenerators.ScriptPropertiesGenerator\XYZ_ScriptProperties.generated.cs(36,13): error CS8331: Cannot assign to variable 'in godot_variant' b
ecause it is a readonly variable [PROJECT.csproj]

Steps to reproduce

  1. Create a new project
  2. Create a C# script deriving from Node (or in my test case it was HBoxContainer)
  3. Create a variable private int value;
  4. Build with dotnet build

You will be greeted with a total of 3 errors, all appear to be due to a conflict with the name value which looks to be used internally in Godot

Minimal reproduction project

No response

pihdastudios commented 2 years ago

this also occurs when the variable name is name public String name

I'm using Linux Mint 21 + dotnet6

raulsntos commented 2 years ago

Duplicate of https://github.com/godotengine/godot/issues/66819