File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1118,8 +1118,8 @@ object RefChecks {
11181118 * This check is suppressed if the method is an override. (Because the type of the receiver
11191119 * may be narrower in the override.)
11201120 *
1121- * If the extension method is nilary , it is always hidden by a member of the same name.
1122- * (Either the member is nilary , or the reference is taken as the eta-expansion of the member.)
1121+ * If the extension method is nullary (has no param lists) , it is always hidden by a member of the same name.
1122+ * (Either the member is nullary , or the reference is taken as the eta-expansion of the member.)
11231123 *
11241124 * This check is in lieu of a more expensive use-site check that an application failed to use an extension.
11251125 * That check would account for accessibility and opacity. As a limitation, this check considers
@@ -1161,7 +1161,7 @@ object RefChecks {
11611161 def targetOfHiddenExtension : Symbol =
11621162 val target =
11631163 val target0 = explicitInfo.firstParamTypes.head // required for extension method, the putative receiver
1164- target0.dealiasKeepOpaques.typeSymbol.info
1164+ target0.dealiasKeepOpaques.typeSymbol.info.hiBound
11651165 val member = target.nonPrivateMember(sym.name)
11661166 .filterWithPredicate: member =>
11671167 member.symbol.isPublic && memberHidesMethod(member)
Original file line number Diff line number Diff line change 1+
2+ trait SelectByName [Field <: String & Singleton , Rec <: Tuple ]:
3+ type Out
4+ extension (r : Rec ) def apply [F <: Field ]: Out // warn not crash
You can’t perform that action at this time.
0 commit comments