scala> def f1: String = List(1,2,3,1,2,3).toSet.size.toString
<console>:7: error: polymorphic expression cannot be instantiated to expected type;
found : [B >: Int]()String
required: String
def f1: String = List(1,2,3,1,2,3).toSet.size.toString
^
f1: String
The bit from -Ytyper-debug:
| | | | | | [search #1] start `def f1`, searching for adaptation to pt=scala.this.Function1[scala.this.Function0[lang.this.String],String] (silent: method f1 in $iw, a MethodSymbol with flags <method>) implicits disabled
| | | | | | [search #2] start `def f1`, searching for adaptation to pt=scala.this.Function1[scala.this.<byname>[scala.this.Function0[lang.this.String]],String] (silent: method f1 in $iw, a MethodSymbol with flags <method>) implicits disabled