Skip to content

Annotation does not support unnamed splats #1

@Qard

Description

@Qard

If I use unnamed splats to make the remaining parameters require explicit naming the @[Logit::Log] annotation explodes. I think it might be a Crystal core issue with method.args.splat producing incorrect output, but I'm not 100% certain about that. Reporting that here for now...

Code:

def method(a, *, b)
  # ...
end

Error:

There was a problem expanding macro 'finished'

Code in lib/logit/src/logit/global_finished.cr:7:1

 7 | macro finished
     ^
Called macro defined in lib/logit/src/logit/global_finished.cr:7:1

 7 | macro finished

Which expanded to:

 > 43849 |       class VFS::FileProxy
 > 43850 |
 > 43851 |       def method(a, , b)
                               ^
Error: unexpected token: ","

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