Skip to content

Issue with Array Handling in @AccountKey Macro in AccountKeyMacro.swift #89

@NikolaiMadlener

Description

@NikolaiMadlener

Problem

When trying to create an @AccountKey with an array type, for example, by passing as: [String], the method fails with the following diagnostics error:
'@AccountKey' failed to parse the meta type expression in argument 'as'

@pauljohanneskraft found that the underlying problem seems to be in SpeziAccount > SpeziAcountMacros > AccountKeyMacro.swift : line 119, where metaTypeTypeNameArgument is called. If an array is passed, the method fails with the above mentioned error. It seems like after a recent update, the Abstract Syntax Tree (AST) structure seems to have changed, causing this failure.

Solution

This can be worked around by defining a typealias for the array type. However, we should invest in a real solution to the problem.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions