Merge pull request #2667 from OlegYch/fix-project-macro-error-message

Better error message from project macro
This commit is contained in:
eugene yokota 2016-07-18 11:29:26 -04:00 committed by GitHub
commit f221d0ab28
1 changed files with 1 additions and 1 deletions

View File

@ -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)) }
}