File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -89,11 +89,14 @@ class ShortcutImplicits extends MiniPhase with IdentityDenotTransformer { thisTr
89
89
}
90
90
91
91
/** A new `m$direct` method to accompany the given method `m` */
92
- private def newDirectMethod (sym : Symbol )(implicit ctx : Context ): Symbol =
93
- sym.copy(
92
+ private def newDirectMethod (sym : Symbol )(implicit ctx : Context ): Symbol = {
93
+ val direct = sym.copy(
94
94
name = sym.name.directName,
95
95
flags = sym.flags | Synthetic ,
96
96
info = directInfo(sym.info))
97
+ if (direct.allOverriddenSymbols.isEmpty) direct.resetFlag(Override )
98
+ direct
99
+ }
97
100
98
101
/** The direct method `m$direct` that accompanies the given method `m`.
99
102
* Create one if it does not exist already.
Original file line number Diff line number Diff line change 1
1
object Test {
2
- def main (args : Array [String ]) = {
2
+ def main (args : Array [String ]): Unit = {
3
3
4
4
implicit val world : String = " world!"
5
5
@@ -53,6 +53,10 @@ object Test {
53
53
val c1 : Int = c
54
54
55
55
Contextual .main(args)
56
+
57
+ def foo (s : String ): Stringly [Int ] = 42
58
+
59
+ (if (" " .isEmpty) foo(" " ) else foo(" " )).apply(" " )
56
60
}
57
61
}
58
62
You can’t perform that action at this time.
0 commit comments