Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/core/Annotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 6 additions & 4 deletions compiler/src/dotty/tools/dotc/core/CheckRealizable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down