Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Assets/UdonSharp/Editor/UdonSharpASTVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)
Debug.Assert(visitorContext.returnLabel == null, "Return label must be null");
var returnLabel = visitorContext.labelTable.GetNewJumpLabel("return");
visitorContext.returnLabel = returnLabel;
visitorContext.returnSymbol = null;

visitorContext.uasmBuilder.AddJumpLabel(setter.entryPoint);

Expand Down
6 changes: 6 additions & 0 deletions Assets/UdonSharp/Tests/TestScripts/Core/PropertyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public int MyIntBackedProperty
get { return backingField; }
set
{
if (value == 222)
return;

MyIntProperty = value;
backingField = value;
}
Expand Down Expand Up @@ -85,6 +88,9 @@ public void ExecuteTests()
MyIntBackedProperty = 8;
tester.TestAssertion("Property manual setter", MyIntProperty == 8 && MyIntBackedProperty == 8);

MyIntBackedProperty = 222;
tester.TestAssertion("Property setter return", MyIntBackedProperty == 8);

PropertyTest[] selfArr = new PropertyTest[] { this };

selfArr[0].MyIntProperty = 10;
Expand Down