File tree 4 files changed +7
-7
lines changed
compiler/src/dotty/tools/dotc
4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1017,7 +1017,7 @@ object desugar {
1017
1017
var tested : MemberDef = tree
1018
1018
def fail (msg : String ) = ctx.error(msg, tree.sourcePos)
1019
1019
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 )) {
1021
1021
fail(i " modifier ` $flag` is not allowed for this definition " )
1022
1022
tested = tested.withMods(tested.mods.withoutFlags(flag))
1023
1023
}
Original file line number Diff line number Diff line change @@ -575,7 +575,7 @@ object SymDenotations {
575
575
/** Is this symbol a user-defined opaque alias type? */
576
576
def isOpaqueAlias (implicit ctx : Context ): Boolean = is(Opaque ) && ! isClass
577
577
578
- /** Is this symbol a module that contains of an opaque aliases? */
578
+ /** Is this symbol a module that contains opaque aliases? */
579
579
def containsOpaques (implicit ctx : Context ): Boolean = is(Opaque ) && isClass
580
580
581
581
def seesOpaques (implicit ctx : Context ): Boolean =
Original file line number Diff line number Diff line change @@ -1094,15 +1094,15 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
1094
1094
* but in this case the retries in tryLiftedToThis would be redundant.
1095
1095
*/
1096
1096
private def liftToThis (tp : Type ): Type = {
1097
-
1097
+
1098
1098
def findEnclosingThis (moduleClass : Symbol , from : Symbol ): Type =
1099
1099
if ((from.owner eq moduleClass) && from.isPackageObject && from.is(Opaque )) from.thisType
1100
1100
else if (from.is(Package )) tp
1101
1101
else if ((from eq moduleClass) && from.is(Opaque )) from.thisType
1102
1102
else if (from eq NoSymbol ) tp
1103
1103
else findEnclosingThis(moduleClass, from.owner)
1104
-
1105
- tp.stripTypeVar.stripAnnots match {
1104
+
1105
+ tp match {
1106
1106
case tp : TermRef if tp.symbol.is(Module ) =>
1107
1107
findEnclosingThis(tp.symbol.moduleClass, ctx.owner)
1108
1108
case tp : TypeRef =>
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ class ElimOpaque extends MiniPhase with DenotTransformer {
47
47
info = cinfo.derivedClassInfo(selfInfo = strippedSelfType),
48
48
initFlags = ref.flags &~ Opaque )
49
49
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
52
52
// the alias we'd need a prefix, which we do not have here. To fix this, we'd have to
53
53
// maintain a prefix in UniqueRefDenotations and JointRefDenotations.
54
54
ref
You can’t perform that action at this time.
0 commit comments