Skip to content

Commit cee2331

Browse files
committed
Implement reviewer suggestions
1 parent 7e2cd66 commit cee2331

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ object Types {
524524
}
525525

526526
/** The member with given `name` and required and/or excluded flags */
527-
final def memberBasedOnFlags(name: Name, required: FlagConjunction, excluded: FlagSet)(implicit ctx: Context): Denotation = {
527+
final def memberBasedOnFlags(name: Name, required: FlagConjunction = EmptyFlagConjunction, excluded: FlagSet = EmptyFlags)(implicit ctx: Context): Denotation = {
528528
// We need a valid prefix for `asSeenFrom`
529529
val pre = this match {
530530
case tp: ClassInfo => tp.appliedRef

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
11391139
* result matching `resultType`?
11401140
*/
11411141
def hasExtensionMethod(tp: Type, name: TermName, argType: Type, resultType: Type)(implicit ctx: Context) = {
1142-
val mbr = tp.member(name).suchThat(_.is(ExtensionMethod))
1142+
val mbr = tp.memberBasedOnFlags(name, required = allOf(ExtensionMethod))
11431143
mbr.exists && isApplicable(tp.select(name, mbr), argType :: Nil, resultType)
11441144
}
11451145

@@ -1645,7 +1645,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
16451645

16461646
/** The typed application
16471647
*
1648-
* <nethodRef>(<receiver>) or
1648+
* <methodRef>(<receiver>) or
16491649
* <methodRef>[<type-args>](<receiver>)
16501650
*
16511651
* where <type-args> comes from `pt` if it is a PolyProto.

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ object Implicits {
147147
tpw.derivesFrom(defn.Predef_Conforms) && ref.symbol != defn.Predef_conforms
148148
val hasExtensions = resType match {
149149
case SelectionProto(name, _, _, _) =>
150-
tpw.member(name).hasAltWith(_.symbol.is(ExtensionMethod))
150+
tpw.memberBasedOnFlags(name, required = allOf(ExtensionMethod)).exists
151151
case _ => false
152152
}
153153
val conversionKind =

0 commit comments

Comments
 (0)