sbt / sbt-buildinfo

I know this because build.sbt knows this.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to annotate values with their singleton types

kubukoz opened this issue · comments

Given that values in BuildInfo are constants, we should be able to expose their types as singleton types. That might allow some advanced type-level trickery for manipulating these values.

For example:

object BuildInfo {
  val name: "app" = "app"
}

Of course this only makes sense on Scala versions that support literal singleton types, so this would fail compilation on 2.12 and below, but the option would be opt-in so I don't think we need any special treatment for these Scala versions.

Something like this comes to mind:

buildInfoSingletonTypes := true

I just implemented final val support here - #164
Would this cover your use case?

oh wow, how did I not notice this...

it does!!! Thank you.

image