Skip to content

Commit

Permalink
ValName: 'lazy val' now also counts for providing a name
Browse files Browse the repository at this point in the history
  • Loading branch information
terpstra committed Dec 1, 2017
1 parent fe8d557 commit a3e4437
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros/src/main/scala/ValName.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object ValNameImpl
def allOwners(s: c.Symbol): Seq[c.Symbol] =
if (s == `NoSymbol`) Nil else s +: allOwners(s.owner)
val terms = allOwners(c.internal.enclosingOwner).filter(_.isTerm).map(_.asTerm)
terms.filter(_.isVal).map(_.name.toString).find(_(0) != '$').map { s =>
terms.filter(t => t.isVal || t.isLazy).map(_.name.toString).find(_(0) != '$').map { s =>
val trim = s.replaceAll("\\s", "")
c.Expr[ValNameImpl] { q"_root_.freechips.rocketchip.macros.ValNameImpl(${trim})" }
}.getOrElse(c.abort(c.enclosingPosition, "Not a valid application."))
Expand Down

0 comments on commit a3e4437

Please sign in to comment.