Skip to content

Commit

Permalink
Ignore const variables in GenConstructor
Browse files Browse the repository at this point in the history
  • Loading branch information
OctopBP committed Oct 18, 2023
1 parent 9b2c0f3 commit f7998e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions UnityAttributes/GenConstructor/GenConstructorGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void OnVisitSyntaxNode(GeneratorSyntaxContext context)
.SelectMany(field => field.Declaration.Variables)
.Select(variable => Unsafe.As<IFieldSymbol>(context.SemanticModel.GetDeclaredSymbol(variable)))
.Where(checkForIgnoreAttribute)
.Where(variable => !variable.IsConst)
.ToArray();

classes.Add((classSymbol, fields));
Expand Down
2 changes: 1 addition & 1 deletion UnityAttributes/UnityAttributes.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.1.2.0</Version>
<Version>1.1.2.1</Version>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>UnityAttributes</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down

0 comments on commit f7998e4

Please sign in to comment.