Skip to content

Commit 308e752

Browse files
committed
Fix attributes on properties
1 parent a1e1a49 commit 308e752

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Assets/UdonSharp/Editor/UdonSharpPropertyVisitor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)
4141
{
4242
foreach (AttributeListSyntax attributes in node.AttributeLists)
4343
{
44-
foreach (AttributeSyntax attribute in attributes.Attributes)
44+
if (attributes.Target != null && attributes.Target.Identifier.Kind() == SyntaxKind.FieldKeyword)
4545
{
46-
if (attributes.Target.Identifier.Kind() == SyntaxKind.FieldKeyword)
46+
foreach (AttributeSyntax attribute in attributes.Attributes)
4747
{
4848
using (ExpressionCaptureScope attributeTypeCapture = new ExpressionCaptureScope(visitorContext, null))
4949
{

Assets/UdonSharp/Tests/TestScripts/Core/PropertyTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
using JetBrains.Annotations;
23
using UdonSharp;
34
using UnityEngine;
45
using VRC.SDKBase;
@@ -14,6 +15,7 @@ public class PropertyTest : UdonSharpBehaviour
1415

1516
public string MyStrProperty => "Test " + 1;
1617

18+
[PublicAPI]
1719
public int MyIntProperty { get; set; }
1820

1921
float backingFloat;

0 commit comments

Comments
 (0)