From 02394593cf6ed5c092c398cdb1908ea5b0928d6a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 21 Aug 2013 11:16:59 +0200 Subject: Fixes to import handling and adaptation and implicits --- src/dotty/tools/dotc/core/Types.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index e263cf076..6afd4e92d 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1130,6 +1130,11 @@ object Types { */ trait BindingType extends Type + /** A trait for proto-types, used as expected types in typer */ + trait ProtoType extends UncachedGroundType { + def isMatchedBy(tp: Type)(implicit ctx: Context): Boolean + } + // --- NamedTypes ------------------------------------------------------------------ /** A NamedType of the form Prefix # name */ @@ -1952,8 +1957,8 @@ object Types { if (annots.isEmpty) underlying else (underlying /: annots)((tp, ann) => AnnotatedType(ann, tp)) } - // Special type objects and classes ----------------------------------------------------- + // Special type objects and classes ----------------------------------------------------- /** The type of an import clause tree */ case class ImportType(expr: Tree) extends UncachedGroundType @@ -2222,7 +2227,7 @@ object Types { /** A filter for names of deferred term definitions of a given type */ object abstractTermNameFilter extends NameFilter { def apply(pre: Type, name: Name)(implicit ctx: Context): Boolean = - name.isTermName && (pre member name).hasAltWith(_ is Deferred) + name.isTermName && (pre member name).hasAltWith(_.symbol is Deferred) } object typeNameFilter extends NameFilter { @@ -2235,7 +2240,7 @@ object Types { object implicitFilter extends NameFilter { def apply(pre: Type, name: Name)(implicit ctx: Context): Boolean = - (pre member name).hasAltWith(_ is Implicit) + (pre member name).hasAltWith(_.symbol is Implicit) } // ----- Exceptions ------------------------------------------------------------- -- cgit v1.2.3