Please check if the following behavior is by design.
class ConflictClassDef { int conflict = 111; void MethodDef(int conflict = 222, int conflictCheck = conflict) { Print(conflict); Print(conflictCheck); } }
SCRIPT : int conflict = 222 SCRIPT : int conflictCheck = 222
I would have expected conflictCheck to be 111 as it should reference the class property and not the previously defined function.
If you swap the order it does not know the conflicting name yet and in this case, does not even attempt to use the class property and instead falls back to the default value.
class ConflictClassDef { int conflict = 111; void MethodDef(int conflictCheck = conflict, int conflict = 222) { Print(conflict); Print(conflictCheck); } }
SCRIPT : int conflict = 222 SCRIPT : int conflictCheck = 0
An easy "fix" if this is not intended would be to not allow non-compile-time constants as assignment expressions for parameters. That is what C# does.