File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1127,16 +1127,17 @@ class Definitions {
11271127 * any definitions of `denot` that have the same name as one of the copied
11281128 * definitions.
11291129 *
1130+ * If an object is present in both the original class and the patch class,
1131+ * it is not overwritten. Instead its members are copied recursively.
1132+ *
11301133 * To avpid running into cycles on bootstrap, patching happens only if `patchCls`
11311134 * is read from a classfile.
11321135 */
11331136 def patchStdLibClass (denot : ClassDenotation )(using Context ): Unit =
11341137
1135- def recurse (patch : Symbol ) =
1136- patch.name.toString.startsWith(" experimental" )
1137-
11381138 def patch2 (denot : ClassDenotation , patchCls : Symbol ): Unit =
11391139 val scope = denot.info.decls.openForMutations
1140+ def recurse (patch : Symbol ) = patch.is(Module ) && scope.lookup(patch.name).exists
11401141 if patchCls.exists then
11411142 val patches = patchCls.info.decls.filter(patch =>
11421143 ! patch.isConstructor && ! patch.isOneOf(PrivateOrSynthetic ))
You can’t perform that action at this time.
0 commit comments