Skip to content

Commit 2147606

Browse files
authored
Merge pull request #6627 from dotty-staging/fix-2.12-build
Fix 2.12 build
2 parents 323c6a7 + 5513eac commit 2147606

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
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.applyOrElse(tree, _ => false)) {
1020+
if (tested.mods.is(flag) && !test.applyOrElse(tree, (md: MemberDef) => 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/Annotations.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ object Annotations {
181181
object WithBounds {
182182
def unapply(ann: Annotation)(implicit ctx: Context): Option[TypeBounds] =
183183
if (ann.symbol == defn.WithBoundsAnnot) {
184+
import ast.Trees._
184185
// We need to extract the type of the type tree in the New itself.
185186
// The annotation's type has been simplified as the type of an expression,
186187
// which means that `&` or `|` might have been lost.

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,18 @@ class CheckRealizable(implicit ctx: Context) {
146146
private def boundsRealizability(tp: Type) = {
147147

148148
val memberProblems =
149-
for mbr <- tp.nonClassTypeMembers if !(mbr.info.loBound <:< mbr.info.hiBound)
150-
yield new HasProblemBounds(mbr.name, mbr.info)
149+
for {
150+
mbr <- tp.nonClassTypeMembers
151+
if !(mbr.info.loBound <:< mbr.info.hiBound)
152+
} yield new HasProblemBounds(mbr.name, mbr.info)
151153

152154
val refinementProblems =
153-
for
155+
for {
154156
name <- refinedNames(tp)
155157
if (name.isTypeName)
156158
mbr <- tp.member(name).alternatives
157159
if !(mbr.info.loBound <:< mbr.info.hiBound)
158-
yield new HasProblemBounds(name, mbr.info)
160+
} yield new HasProblemBounds(name, mbr.info)
159161

160162
def baseTypeProblems(base: Type) = base match {
161163
case AndType(base1, base2) =>

0 commit comments

Comments
 (0)