Skip to content

[Bug] Auto-closures are not forwarded correctly #134

@graycampbell

Description

@graycampbell

Swift Version

6.0

Package Version

0.2.2

Bug Description

If a mocked protocol has a method with an auto-closure parameter, the compiler throws an error: Add () to forward '@autoclosure' parameter.

Steps to Reproduce

@Mocked
protocol Playground {
    func method(closure: @escaping @autoclosure () -> Int)
}

Expected Behavior

The mock should compile without any errors.

Actual Behavior

The compiler throws an error: Add () to forward '@autoclosure' parameter.

Code of Conduct

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions