Skip to content

Commit

Permalink
Merge pull request #45 from Funkest/funkest/ulid-generic-sub
Browse files Browse the repository at this point in the history
Make it work with 'UnitOf<Ulid>'
  • Loading branch information
hadashiA authored Feb 9, 2024
2 parents 3ac1cc8 + 2b0ebc7 commit dbcdaa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UnitGenerator/SourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ bool IsImplementedGenericSelfType(INamedTypeSymbol interfaceSymbol)

class SyntaxReceiver : ISyntaxReceiver
{
public List<(StructDeclarationSyntax type, AttributeSyntax attr, PredefinedTypeSyntax? targetType)> Targets { get; } = new();
public List<(StructDeclarationSyntax type, AttributeSyntax attr, TypeSyntax? targetType)> Targets { get; } = new();

public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
{
Expand All @@ -1372,7 +1372,7 @@ from attribute in attributesList.Attributes
SimpleNameSyntax name => name.Identifier.Text,
_ => attribute.Name.ToString(),
}
let targetType = attribute.Name is GenericNameSyntax gName ? gName.TypeArgumentList.ChildNodes().FirstOrDefault() as PredefinedTypeSyntax : null
let targetType = attribute.Name is GenericNameSyntax gName ? gName.TypeArgumentList.ChildNodes().FirstOrDefault() as TypeSyntax : null
where attributeName is "UnitOf" or "UnitOfAttribute"
select new { attribute, targetType }).FirstOrDefault();

Expand Down

0 comments on commit dbcdaa5

Please sign in to comment.