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 {
1118
1118
* This check is suppressed if the method is an override. (Because the type of the receiver
1119
1119
* may be narrower in the override.)
1120
1120
*
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.)
1123
1123
*
1124
1124
* This check is in lieu of a more expensive use-site check that an application failed to use an extension.
1125
1125
* That check would account for accessibility and opacity. As a limitation, this check considers
@@ -1161,7 +1161,7 @@ object RefChecks {
1161
1161
def targetOfHiddenExtension : Symbol =
1162
1162
val target =
1163
1163
val target0 = explicitInfo.firstParamTypes.head // required for extension method, the putative receiver
1164
- target0.dealiasKeepOpaques.typeSymbol.info
1164
+ target0.dealiasKeepOpaques.typeSymbol.info.hiBound
1165
1165
val member = target.nonPrivateMember(sym.name)
1166
1166
.filterWithPredicate: member =>
1167
1167
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