aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/ast/TypedTrees.scala2
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala2
-rw-r--r--src/dotty/tools/dotc/core/Types.scala4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/ast/TypedTrees.scala b/src/dotty/tools/dotc/ast/TypedTrees.scala
index fbd9a37c4..58c650f41 100644
--- a/src/dotty/tools/dotc/ast/TypedTrees.scala
+++ b/src/dotty/tools/dotc/ast/TypedTrees.scala
@@ -303,7 +303,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
if (id.isType) id else id withType id.tpe.underlyingIfRepeated
def seqToRepeated(tree: Tree)(implicit ctx: Context): Tree =
- Typed(tree, TypeTree(tree.tpe.translateParameterized(defn.SeqClass, defn.RepeatedParamClass)))
+ Typed(tree, TypeTree(tree.tpe.widen.translateParameterized(defn.SeqClass, defn.RepeatedParamClass)))
// ------ Creating typed equivalents of trees that exist only in untyped form -------
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index 11e826464..8d05a4324 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -37,7 +37,7 @@ trait TypeOps { this: Context =>
//
// But in Scala 2.x, its type is Int, which is the dealiased version
// of xs.T. With the logic below, we get the same outcome as for 2.x.
- if ((tp1 ne tp) && (sym is (TypeParam, butNot = Deferred))) tp1.dealias
+ if ((tp1 ne tp) && (sym is (TypeParam, butNot = Deferred))) tp1.dealias // todo: why not TypeArgument?
else tp1
}
case ThisType(thiscls) =>
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index bcc447f8a..83b8cb5dc 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -243,6 +243,8 @@ object Types {
case tp: TypeRef =>
val sym = tp.symbol
if (sym.isClass) sym else tp.underlying.classSymbol
+ case tp: TermRef =>
+ NoSymbol
case tp: TypeProxy =>
tp.underlying.classSymbol
case AndType(l, r) =>
@@ -679,7 +681,7 @@ object Types {
* else the type itself.
*/
def underlyingIfRepeated(implicit ctx: Context): Type =
- if (isRepeatedParam) dealias else this
+ translateParameterized(defn.RepeatedParamClass, defn.SeqClass)
// ----- Access to parts --------------------------------------------