aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-08-21 11:16:59 +0200
committerMartin Odersky <odersky@gmail.com>2013-08-21 11:16:59 +0200
commit02394593cf6ed5c092c398cdb1908ea5b0928d6a (patch)
tree6e26b7daaaae2ca12038e30340995c145c22bbd1 /src/dotty/tools/dotc/core/Types.scala
parentf19ea205446ec1d5e356097c56312829e31dfc13 (diff)
downloaddotty-02394593cf6ed5c092c398cdb1908ea5b0928d6a.tar.gz
dotty-02394593cf6ed5c092c398cdb1908ea5b0928d6a.tar.bz2
dotty-02394593cf6ed5c092c398cdb1908ea5b0928d6a.zip
Fixes to import handling and adaptation and implicits
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala11
1 files changed, 8 insertions, 3 deletions
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 -------------------------------------------------------------