Skip to content

Commit f3f7b58

Browse files
committed
Resolve previously marked issues
1 parent 021ddd3 commit f3f7b58

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
@@ -767,7 +767,6 @@ object SymDenotations {
767767
isPackageObject ||
768768
isTerm && !is(MethodOrLazy, butNot = Label) && !isLocalDummy
769769

770-
// def isOverridable: Boolean = !!! need to enforce that classes cannot be redefined
771770
def isSkolem: Boolean = name == nme.SKOLEM
772771

773772
def isInlineMethod(implicit ctx: Context): Boolean = is(InlineMethod, butNot = Accessor)
@@ -1673,7 +1672,7 @@ object SymDenotations {
16731672

16741673
/*>|>*/ trace.onDebug(s"$tp.baseType($this)") /*<|<*/ {
16751674
Stats.record("baseTypeOf")
1676-
tp.stripTypeVar match { // @!!! dealias?
1675+
tp.stripTypeVar match {
16771676
case tp: CachedType =>
16781677
val btrCache = baseTypeCache
16791678
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
@@ -3434,23 +3434,10 @@ object Types {
34343434
val cls = tp.cls
34353435
// Note: Taking a normal typeRef does not work here. A normal ref might contain
34363436
// also other information about the named type (e.g. bounds).
3437-
if (true) { // ###
3438-
val loOK =
3439-
lo.isRef(tp.cls) ||
3440-
lo.isRef(defn.NothingClass) ||
3441-
lo.isRef(defn.NullClass) && !tp.cls.isValueClass
3442-
val hiOK =
3443-
hi.isRef(tp.cls) ||
3444-
tp.parents.exists(p => p <:< hi)
3445-
loOK && hiOK || {
3446-
println(i"NOT CONTAINS: $this / $tp")
3447-
false
3448-
}
3449-
}
3450-
else contains(
3451-
TypeRef(tp.prefix, cls)
3452-
.withDenot(new UniqueRefDenotation(cls, tp, cls.validFor)))
3453-
case _ => lo <:< tp && tp <:< hi
3437+
contains(
3438+
TypeRef(tp.prefix, cls).withDenot(new UniqueRefDenotation(cls, tp, cls.validFor)))
3439+
case _ =>
3440+
lo <:< tp && tp <:< hi
34543441
}
34553442

34563443
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)