"Error after macro substitution..." when using OCMock's "andReturn"

Answered

Hi,

I use AppCode 3.2 (Build OC-141.2456) and OCMock 3.1.3. When stubbing a method with OCMock the andReturn macro causes an Error:(44, 66) Error after macro substitution: Pointer to non-const type 'id *' with no explicit lifetime. It doesn't matter wheather the returned value is an object or a primitive type.

I've already searched the issue tracker but found nothing related - does anybody have a hint if that's an AppCode or OCMock issue?


Thanks
Florian

0
7 comments
Avatar
Permanently deleted user

Hi, same issue here. Appeared after upgrading OCMock to current version (AppCode 3.2, OCMock 3.1.5)

0
Avatar
Permanently deleted user

Would you be able to check if the problem persist on latest AppCode EAP (build 142.5239.5)?
If yes, could you please create issue in tracker and provide a self-sufficient snippet or sample project to reproduce (wasn't able to do that without context, works fine for me with OCMock 3.1.5).

0
Avatar
Permanently deleted user

The issue occures with an enabled "Perform code analysis" when you try to commiting to git.

0
Avatar
Permanently deleted user

Still not able to repro. Please, report to tracker and provide snippet/sample project.

0
Avatar
Permanently deleted user

I have this issue, too.  

AppCode 2016.1.1
Build #OC-145.597, built on April 6, 2016
JRE: 1.8.0_40-release-b132 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

OCMock Version 3.2

0
Avatar
Permanently deleted user

Same issue here,

AppCode version 2016.2.4

OCMock Version 3.3.1

And I had another issue similar to this issue,

Using Kiwi Version 2.4

and using `let(var, ^{});` block, show same error

1
Avatar
Permanently deleted user

Hi Marcus, 

Please vote for / watch OC-12734.

1

Please sign in to leave a comment.