Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Add sbt-bintray release setup #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add sbt-bintray release setup #6

wants to merge 1 commit into from

Conversation

Daenyth
Copy link
Contributor

@Daenyth Daenyth commented Aug 30, 2019

Close #3

@Daenyth Daenyth requested a review from drobert August 30, 2019 17:50
addCompilerPlugin(
"org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
),
// `val q"... $_ ..." = tree` fires "unused pattern variables" warning
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't follow this line or the comment at all...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use pattern bindings in val declarations, like val List(one, two) = List(1, 2)

I'm using quasiquotes to parse the existing source AST and generate more AST. Those support pattern bindings, like

val q"class $className {}" = q"class FooBar {}"
assert(className == tq"FooBar") // tq = the text is parsed as a `Type` rather than a `Term`

When I discard parts of the AST that aren't useful to me by binding them with $_, the compiler lint "Unused pattern variable" is triggered, which cases compile to fail since I'm using -Xfatal-warnings. If I don't bind them, the binding throws a MatchException, as if I had done val List(one) = List(1, 2)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up sbt-bintray publishing
2 participants