File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -181,11 +181,14 @@ object ShortcutImplicits {
181181 }
182182
183183 /** A new `m$direct` method to accompany the given method `m` */
184- private def newShortcutMethod (sym : Symbol )(implicit ctx : Context ): Symbol =
185- sym.copy(
184+ private def newShortcutMethod (sym : Symbol )(implicit ctx : Context ): Symbol = {
185+ val direct = sym.copy(
186186 name = DirectMethodName (sym.name.asTermName).asInstanceOf [sym.ThisName ],
187- flags = sym.flags &~ Override | Synthetic ,
187+ flags = sym.flags | Synthetic ,
188188 info = directInfo(sym.info))
189+ if (direct.allOverriddenSymbols.isEmpty) direct.resetFlag(Override )
190+ direct
191+ }
189192
190193 def shortcutMethod (sym : Symbol , phase : DenotTransformer )(implicit ctx : Context ) =
191194 sym.owner.info.decl(DirectMethodName (sym.name.asTermName))
Original file line number Diff line number Diff line change 1+ class Foo1 {
2+ def foo : implicit String => Int = 1
3+ }
4+
5+ class Foo2 extends Foo1 {
6+ override def foo : implicit String => Int = 2
7+ }
You can’t perform that action at this time.
0 commit comments