aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Implicits.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-15 16:41:23 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-15 16:41:23 +0100
commitf1cfe733d9d02dff975d2bde222db890ca6d15e6 (patch)
tree4dbc29905abb71c3b8a2228d49d432e52a4e0242 /src/dotty/tools/dotc/typer/Implicits.scala
parent2112492ec908019d1515128c68f1c737518cac3c (diff)
downloaddotty-f1cfe733d9d02dff975d2bde222db890ca6d15e6.tar.gz
dotty-f1cfe733d9d02dff975d2bde222db890ca6d15e6.tar.bz2
dotty-f1cfe733d9d02dff975d2bde222db890ca6d15e6.zip
Allow views when matching the result type of a selection prototype.
More generally, a refactoring of the Compatibility trait to use value passing instead of inheritance.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Implicits.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala
index 396bf2538..2c3914800 100644
--- a/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/src/dotty/tools/dotc/typer/Implicits.scala
@@ -33,7 +33,7 @@ object Implicits {
/** A common base class of contextual implicits and of-type implicits which
* represents as set of implicit references.
*/
- abstract class ImplicitRefs(initctx: Context) extends Compatibility {
+ abstract class ImplicitRefs(initctx: Context) {
implicit val ctx: Context =
if (initctx == NoContext) initctx else initctx retractMode Mode.ImplicitsEnabled
@@ -43,13 +43,10 @@ object Implicits {
/** Return those references in `refs` that are compatible with type `pt`. */
protected def filterMatching(pt: Type)(implicit ctx: Context): List[TermRef] = track("filterMatching") {
def refMatches(ref: TermRef)(implicit ctx: Context) =
- (ref.symbol isAccessibleFrom ref.prefix) && isCompatible(normalize(ref, pt), pt)
+ (ref.symbol isAccessibleFrom ref.prefix) && NoViewsAllowed.isCompatible(normalize(ref, pt), pt)
refs filter (refMatches(_)(ctx.fresh.withExploreTyperState.addMode(Mode.TypevarsMissContext))) // create a defensive copy of ctx to avoid constraint pollution
}
-
- /** No further implicit conversions can be applied when searching for implicits. */
- override def viewExists(tp: Type, pt: Type)(implicit ctx: Context) = false
}
/** The implicit references coming from the implicit scope of a type.