@@ -1058,8 +1058,8 @@ object RefChecks {
10581058 * This check is suppressed if the method is an override. (Because the type of the receiver
10591059 * may be narrower in the override.)
10601060 *
1061- * If the extension method is nilary , it is always hidden by a member of the same name.
1062- * (Either the member is nilary , or the reference is taken as the eta-expansion of the member.)
1061+ * If the extension method is parameterless , it is always hidden by a member of the same name.
1062+ * (Either the member is parameterless , or the reference is taken as the eta-expansion of the member.)
10631063 *
10641064 * This check is in lieu of a more expensive use-site check that an application failed to use an extension.
10651065 * That check would account for accessibility and opacity. As a limitation, this check considers
@@ -1079,15 +1079,15 @@ object RefChecks {
10791079 * parameters of the extension method must be distinguishable from the member parameters, as described above.
10801080 */
10811081 def checkExtensionMethods (sym : Symbol )(using Context ): Unit =
1082- if sym.is(Extension ) then
1082+ if sym.is(Extension ) then atPhase(typerPhase) :
10831083 extension (tp : Type )
10841084 def explicit = Applications .stripImplicit(tp.stripPoly, wildcardOnly = true )
10851085 def hasImplicitParams = tp.stripPoly match { case mt : MethodType => mt.isImplicitMethod case _ => false }
1086- def isNilary = tp.stripPoly match { case mt : MethodType => false case _ => true }
1086+ def isParamLess = tp.stripPoly match { case mt : MethodType => false case _ => true }
10871087 val explicitInfo = sym.info.explicit // consider explicit value params
10881088 def memberHidesMethod (member : Denotation ): Boolean =
10891089 val methTp = explicitInfo.resultType // skip leading implicits and the "receiver" parameter
1090- if methTp.isNilary then
1090+ if methTp.isParamLess then
10911091 return true // extension without parens is always hidden by a member of same name
10921092 val memberIsImplicit = member.info.hasImplicitParams
10931093 inline def paramsCorrespond =
@@ -1096,7 +1096,8 @@ object RefChecks {
10961096 else methTp.explicit.firstParamTypes
10971097 val memberParamTps = member.info.stripPoly.firstParamTypes
10981098 memberParamTps.corresponds(paramTps): (m, x) =>
1099- m.typeSymbol.denot.isOpaqueAlias == x.typeSymbol.denot.isOpaqueAlias && (x frozen_<:< m)
1099+ m.typeSymbol.denot.isOpaqueAlias == x.typeSymbol.denot.isOpaqueAlias
1100+ && (x frozen_<:< m)
11001101 memberIsImplicit && ! methTp.hasImplicitParams || paramsCorrespond
11011102 def targetOfHiddenExtension : Symbol =
11021103 val target =
0 commit comments