Skip to content

Commit 0c1db9a

Browse files
authored
Protect moduleNestedCtx to prevent it from being imported by import build._ (#5346)
Fixes #5345 The basic problem was that `import build._` pulled in the `build.moduleNestedCtx` implicit, which depending on scoping could over-ride the lexical `moduleNestedCtx`. This fix makes `moduleNestedCtx` `protected`, so it is available in the nested scope but cannot be imported Tested manually, seems to fix the reported problem
1 parent 576d80f commit 0c1db9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/define/src/mill/define/Module.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import scala.reflect.ClassTag
1616
* the concrete instance.
1717
*/
1818
trait Module extends Module.BaseClass with ModuleCtx.Wrapper with ModuleApi {
19-
implicit def moduleNestedCtx: ModuleCtx.Nested = moduleCtx
19+
protected implicit def moduleNestedCtx: ModuleCtx.Nested = moduleCtx
2020
.withMillSourcePath(moduleDir)
2121
.withSegments(moduleSegments)
2222
.withEnclosingModule(this)

0 commit comments

Comments
 (0)