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

Eta-expansion of zero-argument method values is deprecated #224

Closed
jpork opened this issue Apr 9, 2018 · 1 comment
Closed

Eta-expansion of zero-argument method values is deprecated #224

jpork opened this issue Apr 9, 2018 · 1 comment

Comments

@jpork
Copy link

jpork commented Apr 9, 2018

Using scala-2.12.4, java9 and scalamock-3.6.0 I get for the follwing code:

val process = stub[Process]
    (process.getInputStream _ ).when().returns(new ByteArrayInputStream("data".getBytes(UTF_8)))

the following Eta-expansion deprecation warning:

Eta-expansion of zero-argument method values is deprecated. Did you intend to write process.getInputStream()?
    (process.getInputStream _ ).when().returns(new ByteArrayInputStream("data".getBytes(UTF_8)))

What can I do in order to prevent this warning?

@barkhorn
Copy link
Collaborator

I recently merged a PR which sounds similar: #219

that changed
(mockTurtle.penUp _) expects ()
to
(() => mockTurtle.penUp) expects ()

Keep in mind that Scalamock 3.6.0 is not supported anymore, you should consider using 4.1.0 now.

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

2 participants