aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-06-20 13:02:53 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:35:04 +0200
commit0965e1a33fe27edbaa98e7bdf8a635cbc4e19b7d (patch)
tree94558c04b247fe2f077eb274919f574ee0749ed6 /src/dotty/tools/dotc/core/Types.scala
parent98b466c14cda8ea5a9d2e8efdfada5b735bb4d95 (diff)
downloaddotty-0965e1a33fe27edbaa98e7bdf8a635cbc4e19b7d.tar.gz
dotty-0965e1a33fe27edbaa98e7bdf8a635cbc4e19b7d.tar.bz2
dotty-0965e1a33fe27edbaa98e7bdf8a635cbc4e19b7d.zip
Handle TypeLambdas in findMember
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index a9fc294cd..c23050c19 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -462,12 +462,12 @@ object Types {
goParam(tp)
case tp: RecType =>
goRec(tp)
- case tp: HKApply =>
- go(tp.upperBound)
case tp: TypeProxy =>
go(tp.underlying)
case tp: ClassInfo =>
tp.cls.findMember(name, pre, excluded)
+ case tp: TypeLambda =>
+ go(tp.resType)
case AndType(l, r) =>
goAnd(l, r)
case OrType(l, r) =>
@@ -2302,7 +2302,7 @@ object Types {
object AndType {
def apply(tp1: Type, tp2: Type)(implicit ctx: Context) = {
- assert(tp1.isInstanceOf[ValueType] && tp2.isInstanceOf[ValueType])
+ assert(tp1.isInstanceOf[ValueType] && tp2.isInstanceOf[ValueType], i"$tp1 & $tp2 / " + s"$tp1 & $tp2")
if (Config.checkKinds)
assert((tp1.knownHK - tp2.knownHK).abs <= 1, i"$tp1 & $tp2 / " + s"$tp1 & $tp2")
unchecked(tp1, tp2)
@@ -2742,7 +2742,7 @@ object Types {
protected def checkInst(implicit ctx: Context): this.type = {
def check(tycon: Type): Unit = tycon.stripTypeVar match {
case tycon: TypeRef if !tycon.symbol.isClass =>
- case _: PolyParam | ErrorType =>
+ case _: PolyParam | ErrorType | _: WildcardType =>
case _: TypeLambda =>
assert(args.exists(_.isInstanceOf[TypeBounds]), s"unreduced type apply: $this")
case tycon: AnnotatedType =>
@@ -3554,6 +3554,7 @@ object Types {
try this(arg)
finally variance = saved
}
+ assert(tp.args.length == tp.typeParams.length, tp)
derivedAppliedType(tp, this(tp.tycon),
tp.args.zipWithConserve(tp.typeParams)(mapArg))