Skip to content

Commit 24b8f12

Browse files
committed
.
1 parent ec853af commit 24b8f12

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

runner/meta/src/mill/meta/CodeGen.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ object CodeGen {
347347
case None => ()
348348
}
349349

350+
var generatedStub: String = ""
350351
newScriptCode = objectData.parent.applyTo(
351352
newScriptCode,
352353
if (objectData.parent.text == null) {
@@ -366,14 +367,21 @@ object CodeGen {
366367
else ", " // no separator found, just use `,` by default
367368
}
368369

369-
newParent + sep + objectData.parent.text
370+
val stub = "_MillRootModuleParents"
371+
.take(objectData.parent.text.length)
372+
.padTo(objectData.parent.text.length, ' ')
373+
374+
generatedStub = s"class $stub extends $newParent$sep${objectData.parent.text}"
375+
376+
stub
370377
}
371378
)
372379

373380
newScriptCode = objectData.name.applyTo(newScriptCode, CGConst.wrapperObjectName)
374-
newScriptCode = objectData.obj.applyTo(newScriptCode, "abstract class")
381+
newScriptCode = objectData.obj.applyTo(newScriptCode, "class")
375382

376383
s"""$headerCode
384+
|$generatedStub
377385
|$markerComment
378386
|$newScriptCode
379387
|""".stripMargin

0 commit comments

Comments
 (0)