File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed
compiler/src/dotty/tools/dotc
library/src-3.x/scala/internal Expand file tree Collapse file tree 4 files changed +8
-5
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.applyOrElse(tree, _ => false )) {
1020
+ if (tested.mods.is(flag) && ! test.applyOrElse(tree, ( md : MemberDef ) => 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 @@ -181,6 +181,7 @@ object Annotations {
181
181
object WithBounds {
182
182
def unapply (ann : Annotation )(implicit ctx : Context ): Option [TypeBounds ] =
183
183
if (ann.symbol == defn.WithBoundsAnnot ) {
184
+ import ast .Trees ._
184
185
// We need to extract the type of the type tree in the New itself.
185
186
// The annotation's type has been simplified as the type of an expression,
186
187
// which means that `&` or `|` might have been lost.
Original file line number Diff line number Diff line change @@ -146,16 +146,18 @@ class CheckRealizable(implicit ctx: Context) {
146
146
private def boundsRealizability (tp : Type ) = {
147
147
148
148
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)
151
153
152
154
val refinementProblems =
153
- for
155
+ for {
154
156
name <- refinedNames(tp)
155
157
if (name.isTypeName)
156
158
mbr <- tp.member(name).alternatives
157
159
if ! (mbr.info.loBound <:< mbr.info.hiBound)
158
- yield new HasProblemBounds (name, mbr.info)
160
+ } yield new HasProblemBounds (name, mbr.info)
159
161
160
162
def baseTypeProblems (base : Type ) = base match {
161
163
case AndType (base1, base2) =>
File renamed without changes.
You can’t perform that action at this time.
0 commit comments