Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method cannot be declared open because its parameter uses an internal type #315

Closed
m7mdra opened this issue May 25, 2022 · 6 comments
Closed

Comments

@m7mdra
Copy link

m7mdra commented May 25, 2022

Hello

I'm using latest version of the library 4.1.0

everything went smoothly until i tried to use mock i get this error

Method cannot be declared open because its parameter uses an internal type

marking mocked protocol and classes as public resolve the issue but i don't know if is intended to work this way its a bug

swiftymocky doctor

✅  XCode project found at: /Users/user12/Desktop/project1/project1.xcodeproj

1. Inspecting tools dependencies:
  ✅  Mint available
  ✅  Sourcery is available through Mint
  ⚠️  Mint does not yet have matching Sourcery version installed.
  Required Sourcery version would be installed upon first generation. It might take a bit more time

2. Inspecting Mockfile:
  ✅  Mockfile exists
  ✅  Mockfile contains mocks definitions

3. Linting 'project1Tests' mock:
  ✅  Output file exists
  Targets:
  ✅  Mock defines targets correctly
  ✅  All targets include './project1Tests/Mock.generated.swift' file.
  Sources:
  ✅  Sources are defined correctly
  Imports:
  ✅  Testable imports are defined
  ✅  Imports are defined

it shows a warning Mint does not yet have matching Sourcery version installed. but i dont it is relevant to my problem

thanks in advance.

@spaluchiewicz
Copy link
Member

@m7mdra could you please switch to brew:

README is pending update to include this: #320

@m7mdra
Copy link
Author

m7mdra commented Aug 20, 2022

Thank you, i found a solution long time ago but forgot to close the issue, thanks again.

@m7mdra m7mdra closed this as completed Aug 20, 2022
@VilemKurz
Copy link

I got the same problem, @m7mdra what was your solution?

@m7mdra
Copy link
Author

m7mdra commented Sep 21, 2022

hey @VilemKurz , it was a long time ago since i worked on that project where i encountered the issue.
maybe if you could show me part of your code where the issue occur... maybe i can help.

maybe also try to follow @spaluchiewicz comment.

@VilemKurz
Copy link

I tried to reinstall using brew, same issue. To reproduce the problem

  1. have internal protocol, with method/properties which use internal types in their signature, marked as mockable
  2. generate mocks
  3. bug: the generated method is public. But types in its signature are internal. Thus, xcode spits the error - title of this issue.

@m7mdra
Copy link
Author

m7mdra commented Sep 21, 2022

@VilemKurz
OK i will try to reproduce the problem and cross compare it with my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants