Cuckoo icon indicating copy to clipboard operation
Cuckoo copied to clipboard

Failed to generate mocks with property wrapper

Open Tyler-Keith-Thompson opened this issue 3 years ago • 1 comments

Hello! I'm getting a phase script error of /Pods/Cuckoo/cuckoo_generator: terminated with signal 4; aborting.

I have narrowed it down and believe it's the following line that's causing an issue

@LazyInjected(Container.service) private var service

Tyler-Keith-Thompson avatar Jun 22 '22 23:06 Tyler-Keith-Thompson

I see, thanks for the report! Do you think just ignoring the wrapper would be a sufficient fix?

MatyasKriz avatar Jul 17 '22 18:07 MatyasKriz

Hi @MatyasKriz,

we have the same issue. We always define protocols and the corresponding class in one file and generate the mocks via --no-class-mocking. Even in this scenario the error occurs. --exclude does unfortunately also not help The only workaround we have right now is to split the protocol and the class definition into different files, which is not really nice

andreasziegl avatar Jan 17 '23 12:01 andreasziegl

fyi this appears to be a duplicate of #341. I have a fix I'll be making a PR for soon (boils down to https://github.com/kabiroberai/Cuckoo/commit/7ea36690c8ad2587004aed2e5229bbd92e4128d9 + some unit tests) — this doesn't allow you to mock property wrappers with inferred types but at least it allows Cuckoo to parse the file without halting and catching fire.

kabiroberai avatar Mar 28 '23 05:03 kabiroberai