Open ArcanoxDragon opened 4 years ago
This is planned, but potentially requires some changes to how the scope of variables is handled.
Technically in standard C# the someValue
variable on both of the two code blocks in my first post would have the same scoping; it's functionally the same, but cleaner to look at. And the discard syntax simply allows you to ignore the out parameter; it doesn't define a variable at all.
Feature Description: If it's possible to implement, it would be nice for UdonSharp to support C#'s
DeclarationExpression
for methods with out parameters, such asint.TryParse
. This would allow the following code:to be condensed into:
Should probably also support the discard syntax:
I know it's only a minor improvement to convenience, but it'd be nice to have if it's an easy addition.