Skip to content

Commit 0c87b7b

Browse files
committed
Resolve previously marked issues
1 parent 5b49561 commit 0c87b7b

File tree

7 files changed

+9
-35
lines changed

7 files changed

+9
-35
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,6 @@ object SymDenotations {
772772
isPackageObject ||
773773
isTerm && !is(MethodOrLazy, butNot = Label) && !isLocalDummy
774774

775-
// def isOverridable: Boolean = !!! need to enforce that classes cannot be redefined
776775
def isSkolem: Boolean = name == nme.SKOLEM
777776

778777
def isInlineMethod(implicit ctx: Context): Boolean = is(InlineMethod, butNot = Accessor)
@@ -1678,7 +1677,7 @@ object SymDenotations {
16781677

16791678
/*>|>*/ trace.onDebug(s"$tp.baseType($this)") /*<|<*/ {
16801679
Stats.record("baseTypeOf")
1681-
tp.stripTypeVar match { // @!!! dealias?
1680+
tp.stripTypeVar match {
16821681
case tp: CachedType =>
16831682
val btrCache = baseTypeCache
16841683
try {

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
6363
toPrefix(pre, cls, tp.cls)
6464
case _: BoundType | NoPrefix =>
6565
tp
66-
case tp: RefinedType => //@!!! todo: remove
67-
derivedRefinedType(tp, apply(tp.parent), apply(tp.refinedInfo))
6866
case _ =>
6967
mapOver(tp)
7068
}
@@ -101,8 +99,6 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
10199
}
102100
case _: ThisType | _: BoundType | NoPrefix =>
103101
tp
104-
case tp: RefinedType => // @!!!
105-
tp.derivedRefinedType(simplify(tp.parent, theMap), tp.refinedName, simplify(tp.refinedInfo, theMap))
106102
case tp: TypeAlias =>
107103
tp.derivedTypeAlias(simplify(tp.alias, theMap))
108104
case AndType(l, r) if !ctx.mode.is(Mode.Type) =>

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3461,23 +3461,10 @@ object Types {
34613461
val cls = tp.cls
34623462
// Note: Taking a normal typeRef does not work here. A normal ref might contain
34633463
// also other information about the named type (e.g. bounds).
3464-
if (true) { // ###
3465-
val loOK =
3466-
lo.isRef(tp.cls) ||
3467-
lo.isRef(defn.NothingClass) ||
3468-
lo.isRef(defn.NullClass) && !tp.cls.isValueClass
3469-
val hiOK =
3470-
hi.isRef(tp.cls) ||
3471-
tp.parents.exists(p => p <:< hi)
3472-
loOK && hiOK || {
3473-
println(i"NOT CONTAINS: $this / $tp")
3474-
false
3475-
}
3476-
}
3477-
else contains(
3478-
TypeRef(tp.prefix, cls)
3479-
.withDenot(new UniqueRefDenotation(cls, tp, cls.validFor)))
3480-
case _ => lo <:< tp && tp <:< hi
3464+
contains(
3465+
TypeRef(tp.prefix, cls).withDenot(new UniqueRefDenotation(cls, tp, cls.validFor)))
3466+
case _ =>
3467+
lo <:< tp && tp <:< hi
34813468
}
34823469

34833470
def & (that: TypeBounds)(implicit ctx: Context): TypeBounds =

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
728728
}
729729
}
730730
case NoPrefix if sym is TypeParam =>
731-
pre = sym.owner.thisType // ### needed?
731+
pre = sym.owner.thisType
732732
case _ =>
733733
}
734734
val tycon = pre.select(sym)

compiler/src/dotty/tools/dotc/transform/ParamForwarding.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,4 @@ class ParamForwarding(thisPhase: DenotTransformer) {
8585

8686
cpy.Template(impl)(body = fwd(impl.body)(ctx.withPhase(thisPhase)))
8787
}
88-
89-
def adaptRef[T <: RefTree](tree: T)(implicit ctx: Context): T = tree // ###
9088
}

compiler/src/dotty/tools/dotc/transform/PostTyper.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
7979
// TODO fill in
8080
}
8181

82-
/** If the type of `tree` is a TermRef with an underdefined
83-
* signature, narrow the type by re-computing the signature (which should
84-
* be fully-defined by now).
85-
*/
86-
private def fixSignature[T <: Tree](tree: T)(implicit ctx: Context): T = tree // ###
87-
8882
class PostTyperTransformer extends Transformer {
8983

9084
private[this] var inJavaAnnot: Boolean = false
@@ -170,15 +164,15 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
170164
case tree: Ident if !tree.isType =>
171165
tree.tpe match {
172166
case tpe: ThisType => This(tpe.cls).withPos(tree.pos)
173-
case _ => paramFwd.adaptRef(fixSignature(tree))
167+
case _ => tree
174168
}
175169
case tree @ Select(qual, name) =>
176170
if (name.isTypeName) {
177171
Checking.checkRealizable(qual.tpe, qual.pos.focus)
178172
super.transform(tree)
179173
}
180174
else
181-
transformSelect(paramFwd.adaptRef(fixSignature(tree)), Nil)
175+
transformSelect(tree, Nil)
182176
case tree: Super =>
183177
if (ctx.owner.enclosingMethod.isInlineMethod)
184178
ctx.error(SuperCallsNotAllowedInline(ctx.owner), tree.pos)

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ class Namer { typer: Typer =>
754754
else levels(c.outer) + 1
755755
println(s"!!!completing ${denot.symbol.showLocated} in buried typerState, gap = ${levels(ctx)}")
756756
}
757-
assert(ctx.runId == creationContext.runId, "completing $denot in wrong run ${ctx.runId}, was created in ${creationContext.runId}")
757+
assert(ctx.runId == creationContext.runId, s"completing $denot in wrong run ${ctx.runId}, was created in ${creationContext.runId}")
758758
completeInCreationContext(denot)
759759
}
760760

0 commit comments

Comments
 (0)