diff options
author | Martin Odersky <odersky@gmail.com> | 2017-02-14 16:53:41 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-02-14 16:53:41 +0100 |
commit | b89738672662863168453a1bd6c6c47a6ff07f11 (patch) | |
tree | 3799954fb6ac7aa581786031834f440172a4e166 /compiler/src/dotty/tools/dotc/core/Definitions.scala | |
parent | 17469b82ca7afc5376bc3906bb5b64d10f38a100 (diff) | |
download | dotty-b89738672662863168453a1bd6c6c47a6ff07f11.tar.gz dotty-b89738672662863168453a1bd6c6c47a6ff07f11.tar.bz2 dotty-b89738672662863168453a1bd6c6c47a6ff07f11.zip |
Avoid automatism for passing variances to PolyTypes
We used to "fill-in" with zeroes if variances were missing. I now
think that;'s too error-prone. Better define all variances explicitly.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Definitions.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 2797bb8a6..c61e92f3a 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -9,6 +9,7 @@ import scala.annotation.{ switch, meta } import scala.collection.{ mutable, immutable } import PartialFunction._ import collection.mutable +import util.common.alwaysZero import scala.reflect.api.{ Universe => ApiUniverse } object Definitions { @@ -152,7 +153,7 @@ class Definitions { resultTypeFn: PolyType => Type, flags: FlagSet = EmptyFlags) = { val tparamNames = tpnme.syntheticTypeParamNames(typeParamCount) val tparamBounds = tparamNames map (_ => TypeBounds.empty) - val ptype = PolyType(tparamNames)(_ => tparamBounds, resultTypeFn) + val ptype = PolyType(tparamNames, tparamNames.map(alwaysZero))(_ => tparamBounds, resultTypeFn) enterMethod(cls, name, ptype, flags) } |