Skip to content

Infinite loop when a function parameter has an unknown attribute #310

@mhdhejazi

Description

@mhdhejazi

https://github.com/birdrides/mockingbird/blob/210ec238b470ac6fd60f7ecfa2218b544519773f/Sources/MockingbirdGenerator/Parser/Models/Function.swift#L91-L112

If you look at line 100, it seems index will always be 0 since @ isn't a letter nor a number which means mutableComponent won't change and we'll keep hitting the same branch indefinitely.

You can reproduce the issue by annotating a parameter with @Sendable for example and you'll see something like this:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions