diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 541fd9ecfc3a..6521deaa1f70 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -1017,7 +1017,7 @@ object desugar { var tested: MemberDef = tree def fail(msg: String) = ctx.error(msg, tree.sourcePos) def checkApplicable(flag: FlagSet, test: MemberDefTest): Unit = - if (tested.mods.is(flag) && !test.applyOrElse(tree, _ => false)) { + if (tested.mods.is(flag) && !test.applyOrElse(tree, (md: MemberDef) => false)) { fail(i"modifier `$flag` is not allowed for this definition") tested = tested.withMods(tested.mods.withoutFlags(flag)) } diff --git a/compiler/src/dotty/tools/dotc/core/Annotations.scala b/compiler/src/dotty/tools/dotc/core/Annotations.scala index b74603d8bd44..c21dadf3ed05 100644 --- a/compiler/src/dotty/tools/dotc/core/Annotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Annotations.scala @@ -181,6 +181,7 @@ object Annotations { object WithBounds { def unapply(ann: Annotation)(implicit ctx: Context): Option[TypeBounds] = if (ann.symbol == defn.WithBoundsAnnot) { + import ast.Trees._ // We need to extract the type of the type tree in the New itself. // The annotation's type has been simplified as the type of an expression, // which means that `&` or `|` might have been lost. diff --git a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala index 0102cc0471d1..e4849bdf1c25 100644 --- a/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala +++ b/compiler/src/dotty/tools/dotc/core/CheckRealizable.scala @@ -146,16 +146,18 @@ class CheckRealizable(implicit ctx: Context) { private def boundsRealizability(tp: Type) = { val memberProblems = - for mbr <- tp.nonClassTypeMembers if !(mbr.info.loBound <:< mbr.info.hiBound) - yield new HasProblemBounds(mbr.name, mbr.info) + for { + mbr <- tp.nonClassTypeMembers + if !(mbr.info.loBound <:< mbr.info.hiBound) + } yield new HasProblemBounds(mbr.name, mbr.info) val refinementProblems = - for + for { name <- refinedNames(tp) if (name.isTypeName) mbr <- tp.member(name).alternatives if !(mbr.info.loBound <:< mbr.info.hiBound) - yield new HasProblemBounds(name, mbr.info) + } yield new HasProblemBounds(name, mbr.info) def baseTypeProblems(base: Type) = base match { case AndType(base1, base2) => diff --git a/library/src/scala/annotation/internal/WithBounds.scala b/library/src-3.x/scala/internal/WithBounds.scala similarity index 100% rename from library/src/scala/annotation/internal/WithBounds.scala rename to library/src-3.x/scala/internal/WithBounds.scala