Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Fix attributes on properties
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinVR committed Jul 17, 2021
1 parent a1e1a49 commit 308e752
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/UdonSharp/Editor/UdonSharpPropertyVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)
{
foreach (AttributeListSyntax attributes in node.AttributeLists)
{
foreach (AttributeSyntax attribute in attributes.Attributes)
if (attributes.Target != null && attributes.Target.Identifier.Kind() == SyntaxKind.FieldKeyword)
{
if (attributes.Target.Identifier.Kind() == SyntaxKind.FieldKeyword)
foreach (AttributeSyntax attribute in attributes.Attributes)
{
using (ExpressionCaptureScope attributeTypeCapture = new ExpressionCaptureScope(visitorContext, null))
{
Expand Down
2 changes: 2 additions & 0 deletions Assets/UdonSharp/Tests/TestScripts/Core/PropertyTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

using JetBrains.Annotations;
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
Expand All @@ -14,6 +15,7 @@ public class PropertyTest : UdonSharpBehaviour

public string MyStrProperty => "Test " + 1;

[PublicAPI]
public int MyIntProperty { get; set; }

float backingFloat;
Expand Down

0 comments on commit 308e752

Please sign in to comment.