aboutsummaryrefslogtreecommitdiff
path: root/src/dotty
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-04-29 16:15:39 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-05-08 21:51:46 +0200
commit15345390b10e60d0cffd0c1eb01a61a9ef28b6d1 (patch)
tree45dd24aaeaf2bfcff4c681792e737af8a918ab5c /src/dotty
parentef8f24203f4a3ef75d0b8e45a9dd9470bd474e7d (diff)
downloaddotty-15345390b10e60d0cffd0c1eb01a61a9ef28b6d1.tar.gz
dotty-15345390b10e60d0cffd0c1eb01a61a9ef28b6d1.tar.bz2
dotty-15345390b10e60d0cffd0c1eb01a61a9ef28b6d1.zip
Excluding <:< from eligible candidates for views.
This is an opimization to save on unncessessary typed implicits.
Diffstat (limited to 'src/dotty')
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala1
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 280e8de76..6f34efc8b 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -178,6 +178,7 @@ class Definitions {
lazy val BoxesRunTimeClass = BoxesRunTimeModule.moduleClass
lazy val DottyPredefModule = ctx.requiredModule("dotty.DottyPredef")
lazy val NilModule = ctx.requiredModule("scala.collection.immutable.Nil")
+ lazy val PredefConformsClass = ctx.requiredClass("scala.Predef." + tpnme.Conforms)
// lazy val FunctionClass: ClassSymbol = ctx.requiredClass("scala.Function")
lazy val SingletonClass: ClassSymbol =
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala
index 4767e6dd3..d4cfc1b8e 100644
--- a/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/src/dotty/tools/dotc/typer/Implicits.scala
@@ -65,7 +65,7 @@ object Implicits {
case tpw =>
//if (ctx.typer.isApplicable(tp, argType :: Nil, resultType))
// println(i"??? $tp is applicable to $this / typeSymbol = ${tpw.typeSymbol}")
- !tpw.derivesFrom(defn.FunctionClass(1))
+ !tpw.derivesFrom(defn.FunctionClass(1)) || tpw.isRef(defn.PredefConformsClass)
}
def discardForValueType(tpw: Type): Boolean = tpw match {