aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-27 18:23:07 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:11 +0200
commit21ab9a1355036aa953db4e1f87c8f0f9a06506b5 (patch)
tree3824573b541226f7e90609e7163383b471838667 /compiler/src/dotty/tools/dotc/core/TypeApplications.scala
parent0efd6b93cf45be4cb211093185fef2923f53ef67 (diff)
downloaddotty-21ab9a1355036aa953db4e1f87c8f0f9a06506b5.tar.gz
dotty-21ab9a1355036aa953db4e1f87c8f0f9a06506b5.tar.bz2
dotty-21ab9a1355036aa953db4e1f87c8f0f9a06506b5.zip
Get rid of ExpandedName flag
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/core/TypeApplications.scala9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
index 94b726491..0220928a2 100644
--- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -11,6 +11,7 @@ import util.Stats._
import util.common._
import Names._
import NameOps._
+import NameExtractors._
import Flags._
import StdNames.tpnme
import util.Positions.Position
@@ -464,11 +465,6 @@ class TypeApplications(val self: Type) extends AnyVal {
self
case _ =>
val v = tparam.paramVariance
- /* Not neeeded.
- if (v > 0 && !(tparam is Local) && !(tparam is ExpandedTypeParam)) TypeBounds.upper(self)
- else if (v < 0 && !(tparam is Local) && !(tparam is ExpandedTypeParam)) TypeBounds.lower(self)
- else
- */
TypeAlias(self, v)
}
@@ -510,13 +506,14 @@ class TypeApplications(val self: Type) extends AnyVal {
*/
final def baseTypeWithArgs(base: Symbol)(implicit ctx: Context): Type = ctx.traceIndented(s"btwa ${self.show} wrt $base", core, show = true) {
def default = self.baseTypeRef(base).appliedTo(baseArgInfos(base))
+ def isExpandedTypeParam(sym: Symbol) = sym.is(TypeParam) && sym.name.is(ExpandedName)
self match {
case tp: TypeRef =>
tp.info match {
case TypeBounds(_, hi) => hi.baseTypeWithArgs(base)
case _ => default
}
- case tp @ RefinedType(parent, name, _) if !tp.member(name).symbol.is(ExpandedTypeParam) =>
+ case tp @ RefinedType(parent, name, _) if !isExpandedTypeParam(tp.member(name).symbol) =>
tp.wrapIfMember(parent.baseTypeWithArgs(base))
case tp: TermRef =>
tp.underlying.baseTypeWithArgs(base)