Skip to content

Commit b128515

Browse files
committed
Prefer enclosing class when lifting nested method definitions
1 parent 60925ac commit b128515

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ abstract class Dependencies(root: ast.tpd.Tree, @constructorOnly rootContext: Co
223223
* the dynamic and static dependencies between ES modules, which is forbidden.
224224
*/
225225
ctx.settings.scalajs.value && encClass.isSubClass(jsdefn.DynamicImportThunkClass)
226+
||
227+
local.defTree.hasAttachment(MethodParameterReturnType)
226228

227229
logicOwner(sym) = if preferEncClass then encClass else local.enclosingPackageClass
228230

0 commit comments

Comments
 (0)