aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-06-29 19:48:40 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:35:01 +0200
commit31af865656ecc352c39ce919981e9b50d42a3237 (patch)
tree5c1f85e80e9e21f49a6c755a6c2415855212fa92 /src/dotty/tools/dotc/core/TypeApplications.scala
parent0a5f8394a4a226bd3dcf9c966495e653a25ed7d2 (diff)
downloaddotty-31af865656ecc352c39ce919981e9b50d42a3237.tar.gz
dotty-31af865656ecc352c39ce919981e9b50d42a3237.tar.bz2
dotty-31af865656ecc352c39ce919981e9b50d42a3237.zip
Fix condition for lambda abstracting in Namer
The previous condition could make a (derived) type a * type for a little while even though it had type parameters. This loophole caused collection/generic/MapFactory.scala and with it compile-stdlib to fail. Refinement for knownHK for PolyParams pos test t2082.scala shows that knownHK can be constructed before the binder PolyType of a PolyParam is initialized.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala
index fc8876d09..c0728a8fb 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -494,7 +494,9 @@ class TypeApplications(val self: Type) extends AnyVal {
case self: SingletonType => -1
case self: TypeVar => self.origin.knownHK
case self: WildcardType => self.optBounds.knownHK
+ case self: PolyParam => self.underlying.knownHK
case self: TypeProxy => self.underlying.knownHK
+ case NoType => 0
case _ => -1
}
@@ -666,13 +668,7 @@ class TypeApplications(val self: Type) extends AnyVal {
instTop(tp.ref)
case tp =>
inst.tyconIsHK = tp.isHK
- val res = inst(tp)
- tp match {
- case tp: WildcardType =>
- println(s"inst $tp --> $res")
- case _ =>
- }
- res
+ inst(tp)
}
def isLazy(tp: Type): Boolean = tp.strictDealias match {