File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -107,8 +107,14 @@ object Implicits {
107107 // emulate the existence of a such a conversion directly in the search.
108108 // The reason for leaving out `Predef_conforms` is that we know it adds
109109 // nothing since it only relates subtype with supertype.
110- ! tpw.isRef(defn.FunctionClass (1 )) &&
111- (! tpw.derivesFrom(defn.Predef_Conforms ) || ref.symbol == defn.Predef_conforms )
110+ //
111+ // We keep the old behavior under -language:Scala2.
112+ val isFunction =
113+ if (ctx.scala2Mode) tpw.derivesFrom(defn.FunctionClass (1 ))
114+ else tpw.isRef(defn.FunctionClass (1 ))
115+ val isConforms =
116+ tpw.derivesFrom(defn.Predef_Conforms ) || ref.symbol == defn.Predef_conforms
117+ ! (isFunction || isConforms)
112118 }
113119
114120 def discardForValueType (tpw : Type ): Boolean = tpw match {
You can’t perform that action at this time.
0 commit comments