From 7820e62e30a63f2b8fd6b8bab8f96be6924a63a1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 17 Mar 2014 17:08:32 +0100 Subject: Fix of t1056 - PartialFunction type T was not recorgnized as a SAM type because a case was missing in zeroParamClass. --- src/dotty/tools/dotc/core/Types.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 9b5e02186..b6b17534e 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1774,7 +1774,7 @@ object Types { // upper bound is not a singleton type, widen the instance. if (fromBelow && isSingleton(inst) && !isSingleton(upperBound)) inst = inst.widen - + inst = inst.simplified // 2. If instance is from below and is a fully-defined union type, yet upper bound @@ -1782,7 +1782,7 @@ object Types { // of all common base types. if (fromBelow && isOrType(inst) && isFullyDefined(inst) && !isOrType(upperBound)) inst = inst.approximateUnion - + instantiateWith(inst) } @@ -2094,6 +2094,8 @@ object Types { zeroParamClass(tp.underlying) case tp: RefinedType => zeroParamClass(tp.underlying) + case tp: TypeBounds => + zeroParamClass(tp.underlying) case tp: TypeVar => zeroParamClass(tp.underlying) case _ => -- cgit v1.2.3