简体   繁体   English

在Scala中是否有使用带有多个参数的隐式函数?

[英]Is there any usage of implicit functions with several parameters in Scala?

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? 但Scala编译器可以用它做一些有用的东西吗? If not, why doesn't it complain? 如果没有,为什么不抱怨?

是的,如果您要求这样的隐式,编译器可以对它做一些事情。

def f(implicit ev: (String, String) => Iterator[String]) = ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM