diff options
author | Martin Odersky <odersky@gmail.com> | 2016-06-29 19:48:40 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-07-11 13:35:01 +0200 |
commit | 31af865656ecc352c39ce919981e9b50d42a3237 (patch) | |
tree | 5c1f85e80e9e21f49a6c755a6c2415855212fa92 /src/dotty/tools/dotc/core/Types.scala | |
parent | 0a5f8394a4a226bd3dcf9c966495e653a25ed7d2 (diff) | |
download | dotty-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/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 986a9c292..d3e97b492 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2765,7 +2765,11 @@ object Types { def paramName = binder.paramNames(paramNum) - override def underlying(implicit ctx: Context): Type = binder.paramBounds(paramNum) + override def underlying(implicit ctx: Context): Type = { + val bounds = binder.paramBounds + if (bounds == null) NoType // this can happen if the PolyType is not initialized yet + else bounds(paramNum) + } // no customized hashCode/equals needed because cycle is broken in PolyType override def toString = s"PolyParam($paramName)" |