14

Implicit functions with several parameters are allowed, that is:

implicit def it(path: String, category: String):Iterator[String] = ...

But can the Scala compiler do something useful with it? If not, why doesn't it complain?

1 Answer 1

18

Yes, the compiler can do something with it if you ask for such an implicit.

def f(implicit ev: (String, String) => Iterator[String]) = ...
Sign up to request clarification or add additional context in comments.

2 Comments

Wonderful scala, if not as implicit converter, then as implicit argument )
@yura If you look into Scala Language Specification, you'll see that these two things are actually unified. Looking up implicit conversion from A to B is equivalent to looking up implicit parameter of type A => B. So implicit conversions and implicit parameters are roughly the same thing under the hood.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.