Skip to content

Conversation

@lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Dec 3, 2025

Fixes #6303

@lefou
Copy link
Member

lefou commented Dec 3, 2025

Is filtering / ignoring the right solution? Shouldn't we either error our or require the user to not mix-in MainModule (which is currently not configurable)?

If we just filter out, what is the correct behavior for mill init in the example given in #6303?

@lihaoyi
Copy link
Member Author

lihaoyi commented Dec 3, 2025

I'm not sure TBH, but we already have an init module in the Mill codebase that would conflict with the init task that Mill comes bundled with, so presumably it won't be uncommon to have such collisions and if we could make it work without error that would be nice

@lefou
Copy link
Member

lefou commented Dec 3, 2025

I'm not sure TBH, but we already have an init module in the Mill codebase that would conflict with the init task that Mill comes bundled with, so presumably it won't be uncommon to have such collisions and if we could make it work without error that would be nice

I think the init module we have is libs.init and not a top-level module, so it won't collide with MainModule.init.

I think there is no room to gracefully handle collisions, if we speak about CLI and API modelling the same name space. E.g. a init module implementing DefaultTaskModule already collides on the CLI. But using some build.init.compile() task via API has to collide when compiling it, if build.init is aleady a task inherited from MainModule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

object init extends ScalaModule causes crash

2 participants