Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings #165

Merged
merged 1 commit into from
Oct 23, 2024
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 @@ -25,18 +25,18 @@ private[sbtcrossproject] object CrossProjectMacros {
val jsPlatform =
Select(
Select(
Ident(newTermName("_root_")),
newTermName("scalajscrossproject")
Ident(TermName("_root_")),
TermName("scalajscrossproject")
),
newTermName("JSPlatform")
TermName("JSPlatform")
)
val jvmPlatform =
Select(
Select(
Ident(newTermName("_root_")),
newTermName("sbtcrossproject")
Ident(TermName("_root_")),
TermName("sbtcrossproject")
),
newTermName("JVMPlatform")
TermName("JVMPlatform")
)

List(jsPlatform, jvmPlatform)
Expand All @@ -45,16 +45,16 @@ private[sbtcrossproject] object CrossProjectMacros {
val crossProjectCompanionTerm =
Select(
Select(
Ident(newTermName("_root_")),
newTermName("sbtcrossproject")
Ident(TermName("_root_")),
TermName("sbtcrossproject")
),
newTermName("CrossProject")
TermName("CrossProject")
)

val applyFun =
Select(
crossProjectCompanionTerm,
newTermName("apply")
TermName("apply")
)

c.Expr[CrossProject.Builder](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ private[sbtcrossproject] object MacroUtils {
val methodName = c.macroApplication.symbol.name

// trim is not strictly correct, but macros don't expose the API necessary
def processName(n: Name): String = n.decoded.trim
def processName(n: Name): String = n.decodedName.toString.trim

def enclosingVal(trees: List[c.Tree]): String = trees match {
case vd @ ValDef(_, name, _, _) :: ts =>
Expand All @@ -27,7 +27,8 @@ private[sbtcrossproject] object MacroUtils {
if mods.hasFlag(Flag.LAZY) =>
processName(name)
case _ =>
c.error(c.enclosingPosition, invalidEnclosingTree(methodName.decoded))
c.error(c.enclosingPosition,
invalidEnclosingTree(methodName.decodedName.toString))
"<error>"
}

Expand Down
Loading