mirror of
https://github.com/sbt/sbt.git
synced 2026-09-03 08:34:34 +02:00
Merge pull request #2667 from OlegYch/fix-project-macro-error-message
Better error message from project macro
This commit is contained in:
@@ -617,7 +617,7 @@ object Project extends ProjectExtra {
|
||||
def projectMacroImpl(c: Context): c.Expr[Project] =
|
||||
{
|
||||
import c.universe._
|
||||
val enclosingValName = std.KeyMacro.definingValName(c, methodName => s"""$methodName must be directly assigned to a val, such as `val x = $methodName`.""")
|
||||
val enclosingValName = std.KeyMacro.definingValName(c, methodName => s"""$methodName must be directly assigned to a val, such as `val x = $methodName`. Alternatively, you can use `sbt.Project.apply`""")
|
||||
val name = c.Expr[String](Literal(Constant(enclosingValName)))
|
||||
reify { Project(name.splice, new File(name.splice)) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user