-
Notifications
You must be signed in to change notification settings - Fork 100
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
Compiler crash on function-return style currying #150
Comments
Corresponding PR adding a test for this case: |
able to reproduce this on 3.4.2, but I feel I lack the knowledge of macros to fix this at the moment. this test compiles and succeeds: val additionFunc = mock[IntFunctions]
val curried = mock[Int => Int]
(additionFunc.cf(_: Int)).expects(*).returning(curried)
(curried.apply _).expects(*).returning(5)
val firstStep = additionFunc.cf(1)
val r = firstStep(2)
r === 5 leaving this in triage for now until I understand it better or someone else wants to submit a PR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mock testing in Specs2, came across a compiler crash that is easily reproducible.
Mock testing works on curried functions in this style:
def func(arg1: A)(arg2: A): A
But it blows up when using the function return style:
def func(arg1: A): A => A
I have reproduced it in a very simple test, using the exact format my actual code contained:
Changing the final bit of the test to
additionFunc.cf(1)(2)
results in the exact same issue.Here is the compiler crash (snippet):
But if I change the implementation to what we see in the documentation:
Then we get a successful test case
[success] Total time: 7 s, completed Aug 8, 2016 5:15:02 PM
The text was updated successfully, but these errors were encountered: