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

Unrecognised structure: Ident(TermName("parseSentenceFn")) on refactoring #113

Closed
janekdb opened this issue Jun 20, 2015 · 3 comments
Closed
Milestone

Comments

@janekdb
Copy link

janekdb commented Jun 20, 2015

When making a change that should be a refactoring a compile error is encountered.

This compiles,

(xClient.parseSentence _).when(*).onCall { p: String => parser(p)}

This fails to compile,

val parseSentenceFn = xClient.parseSentence _
parseSentenceFn.when(*).onCall(parser)
ScalaMock: Unrecognised structure: Ident(TermName("parseSentenceFn"))
@pawel-wiejacha
Copy link
Collaborator

Thanks for the bug report.

It should be easy to fix.

@howyp
Copy link

howyp commented Jul 9, 2015

This caught me too. We managed to work around it for the moment by forcing the implicit conversion to happen at the val declaration, something like:

val parseSentenceFn: StubFunction[_,_] = xClient.parseSentence _
parseSentenceFn.when(*).onCall(parser)

Hope that helps until the bug is fixed!

@janekdb
Copy link
Author

janekdb commented Oct 10, 2015

🍺

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

4 participants