mirror of https://github.com/sbt/sbt.git
Merge pull request #2667 from OlegYch/fix-project-macro-error-message
Better error message from project macro
This commit is contained in:
commit
f221d0ab28
|
|
@ -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)) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue