Skip to content

Commit 0db2b36

Browse files
authored
Merge pull request #4810 from dotty-staging/fix-4753
add doc for Override flag hack in ShortcutImplicits
2 parents 39f47f3 + 5975fc3 commit 0db2b36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/transform/ShortcutImplicits.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ object ShortcutImplicits {
171171
(specializeMonoTargets || !sym.isEffectivelyFinal || sym.allOverriddenSymbols.nonEmpty)
172172

173173
/** @pre The type's final result type is an implicit function type `implicit Ts => R`.
174-
* @return The type of the `apply` member of `implicit Ts => R`.
174+
* @return The type of the `apply` member of `implicit Ts => R`.
175175
*/
176176
private def directInfo(info: Type)(implicit ctx: Context): Type = info match {
177177
case info: PolyType => info.derivedLambdaType(resType = directInfo(info.resultType))
@@ -186,6 +186,7 @@ object ShortcutImplicits {
186186
name = DirectMethodName(sym.name.asTermName).asInstanceOf[sym.ThisName],
187187
flags = sym.flags | Synthetic,
188188
info = directInfo(sym.info))
189+
// make flags conformant to RefChecks. Override is meaningless after RefChecks.
189190
if (direct.allOverriddenSymbols.isEmpty) direct.resetFlag(Override)
190191
direct
191192
}

0 commit comments

Comments
 (0)