@@ -1135,8 +1135,8 @@ object RefChecks {
11351135 * This check is suppressed if the method is an override. (Because the type of the receiver
11361136 * may be narrower in the override.)
11371137 *
1138- * If the extension method is nilary , it is always hidden by a member of the same name.
1139- * (Either the member is nilary , or the reference is taken as the eta-expansion of the member.)
1138+ * If the extension method is parameterless , it is always hidden by a member of the same name.
1139+ * (Either the member is parameterless , or the reference is taken as the eta-expansion of the member.)
11401140 *
11411141 * This check is in lieu of a more expensive use-site check that an application failed to use an extension.
11421142 * That check would account for accessibility and opacity. As a limitation, this check considers
@@ -1156,15 +1156,15 @@ object RefChecks {
11561156 * parameters of the extension method must be distinguishable from the member parameters, as described above.
11571157 */
11581158 def checkExtensionMethods (sym : Symbol )(using Context ): Unit =
1159- if sym.is(Extension ) then
1159+ if sym.is(Extension ) then atPhase(typerPhase) :
11601160 extension (tp : Type )
11611161 def explicit = Applications .stripImplicit(tp.stripPoly, wildcardOnly = true )
11621162 def hasImplicitParams = tp.stripPoly match { case mt : MethodType => mt.isImplicitMethod case _ => false }
1163- def isNilary = tp.stripPoly match { case mt : MethodType => false case _ => true }
1163+ def isParamLess = tp.stripPoly match { case mt : MethodType => false case _ => true }
11641164 val explicitInfo = sym.info.explicit // consider explicit value params
11651165 def memberHidesMethod (member : Denotation ): Boolean =
11661166 val methTp = explicitInfo.resultType // skip leading implicits and the "receiver" parameter
1167- if methTp.isNilary then
1167+ if methTp.isParamLess then
11681168 return true // extension without parens is always hidden by a member of same name
11691169 val memberIsImplicit = member.info.hasImplicitParams
11701170 inline def paramsCorrespond =
@@ -1173,7 +1173,8 @@ object RefChecks {
11731173 else methTp.explicit.firstParamTypes
11741174 val memberParamTps = member.info.stripPoly.firstParamTypes
11751175 memberParamTps.corresponds(paramTps): (m, x) =>
1176- m.typeSymbol.denot.isOpaqueAlias == x.typeSymbol.denot.isOpaqueAlias && (x frozen_<:< m)
1176+ m.typeSymbol.denot.isOpaqueAlias == x.typeSymbol.denot.isOpaqueAlias
1177+ && (x frozen_<:< m)
11771178 memberIsImplicit && ! methTp.hasImplicitParams || paramsCorrespond
11781179 def targetOfHiddenExtension : Symbol =
11791180 val target =
0 commit comments