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 {
107
107
// emulate the existence of a such a conversion directly in the search.
108
108
// The reason for leaving out `Predef_conforms` is that we know it adds
109
109
// 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)
112
118
}
113
119
114
120
def discardForValueType (tpw : Type ): Boolean = tpw match {
You can’t perform that action at this time.
0 commit comments