Skip to content

Commit 44b9562

Browse files
committed
Address review comments
1 parent f9c0614 commit 44b9562

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ object desugar {
10171017
var tested: MemberDef = tree
10181018
def fail(msg: String) = ctx.error(msg, tree.sourcePos)
10191019
def checkApplicable(flag: FlagSet, test: MemberDefTest): Unit =
1020-
if (tested.mods.is(flag) && !(test.isDefinedAt(tree) && test(tree))) {
1020+
if (tested.mods.is(flag) && !test.applyOrElse(tree, _ => false)) {
10211021
fail(i"modifier `$flag` is not allowed for this definition")
10221022
tested = tested.withMods(tested.mods.withoutFlags(flag))
10231023
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ object SymDenotations {
575575
/** Is this symbol a user-defined opaque alias type? */
576576
def isOpaqueAlias(implicit ctx: Context): Boolean = is(Opaque) && !isClass
577577

578-
/** Is this symbol a module that contains of an opaque aliases? */
578+
/** Is this symbol a module that contains opaque aliases? */
579579
def containsOpaques(implicit ctx: Context): Boolean = is(Opaque) && isClass
580580

581581
def seesOpaques(implicit ctx: Context): Boolean =

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1094,15 +1094,15 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
10941094
* but in this case the retries in tryLiftedToThis would be redundant.
10951095
*/
10961096
private def liftToThis(tp: Type): Type = {
1097-
1097+
10981098
def findEnclosingThis(moduleClass: Symbol, from: Symbol): Type =
10991099
if ((from.owner eq moduleClass) && from.isPackageObject && from.is(Opaque)) from.thisType
11001100
else if (from.is(Package)) tp
11011101
else if ((from eq moduleClass) && from.is(Opaque)) from.thisType
11021102
else if (from eq NoSymbol) tp
11031103
else findEnclosingThis(moduleClass, from.owner)
1104-
1105-
tp.stripTypeVar.stripAnnots match {
1104+
1105+
tp match {
11061106
case tp: TermRef if tp.symbol.is(Module) =>
11071107
findEnclosingThis(tp.symbol.moduleClass, ctx.owner)
11081108
case tp: TypeRef =>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class ElimOpaque extends MiniPhase with DenotTransformer {
4747
info = cinfo.derivedClassInfo(selfInfo = strippedSelfType),
4848
initFlags = ref.flags &~ Opaque)
4949
case _ =>
50-
// This is dubbious as it means that we do not see the alias from an external reference
51-
// which has tupe UniqueRefDenotion instead of SymDenotation. But to correctly recompote
50+
// This is dubious as it means that we do not see the alias from an external reference
51+
// which has type UniqueRefDenotation instead of SymDenotation. But to correctly recompute
5252
// the alias we'd need a prefix, which we do not have here. To fix this, we'd have to
5353
// maintain a prefix in UniqueRefDenotations and JointRefDenotations.
5454
ref

0 commit comments

Comments
 (0)