Skip to content

Commit

Permalink
provide better error message in case mock function is assigned to a v…
Browse files Browse the repository at this point in the history
…al. close #113
  • Loading branch information
barkhorn committed Mar 5, 2017
1 parent 0f512cd commit 6cbb4d0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ object MockFunctionFinder {
case Typed(expr, tpt) => transcribeTree(expr)
case Function(vparams, body) => transcribeTree(body)
case Apply(fun, args) => transcribeTree(fun)
case TypeApply(fun, args) => transcribeTree(fun, args.map(_.tpe));
case TypeApply(fun, args) => transcribeTree(fun, args.map(_.tpe))
case Ident(fun) => reportError(s"please declare '$fun' as MockFunctionx or StubFunctionx (e.g val $fun: MockFunction1[X, R] = ... if it has 1 parameter)")
case _ => reportError(
s"ScalaMock: Unrecognised structure: ${showRaw(tree)}." +
"Please open a ticket at https://github.com/paulbutcher/ScalaMock/issues")
Expand Down

0 comments on commit 6cbb4d0

Please sign in to comment.