Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object ModuleOutsideTopLevelModuleTests extends UtestIntegrationTestSuite {
assert(!res.isSuccess)
assert(
res.err.contains(
"Modules and Tasks can only be defined within a mill Module"
"Modules and Tasks can only be defined within a mill Module (in `build.mill` or `package.mill` files)"
)
)
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ object NoModulesInHelperFileTests extends UtestIntegrationTestSuite {
val res = eval(("resolve", "_"))
assert(res.isSuccess == false)
assert(
res.err.contains("Modules and Tasks can only be defined within a mill Module")
res.err.contains(
"Modules and Tasks can only be defined within a mill Module (in `build.mill` or `package.mill` files)"
)
)
assert(res.err.contains("object foo extends Module"))
}
Expand Down
6 changes: 4 additions & 2 deletions main/define/src/mill/define/Ctx.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import scala.annotation.{compileTimeOnly, implicitNotFound}
* @param enclosingCls
* @param crossValues
*/
@implicitNotFound("Modules and Tasks can only be defined within a mill Module")
@implicitNotFound(
"Modules and Tasks can only be defined within a mill Module (in `build.mill` or `package.mill` files)"
)
trait Ctx {
def enclosing: String
def lineNum: Int
Expand Down Expand Up @@ -112,7 +114,7 @@ trait LowPriCtx {
// as it is provided by the codegen. Defined for IDEs to think that one is available
// and not show errors in build.mill/package.mill even though they can't see the codegen
@compileTimeOnly(
"Modules and Tasks can only be defined within a mill Module"
"Modules and Tasks can only be defined within a mill Module (in `build.mill` or `package.mill` files)"
)
implicit def dummyInfo: Ctx = sys.error("implicit Ctx must be provided")
}
Loading