Skip to content

Generated import not compatible with new Scala 3 syntax #171

@kubukoz

Description

@kubukoz

This makes it impossible to use the plugin under Scala 3 with -source future.

Example:

buildInfoKeys := Seq[BuildInfoKey](version),
buildInfoPackage := "com.kubukoz.next"

Generates:

// $COVERAGE-OFF$
package com.kubukoz.next

import scala.Predef._

/** This object was generated by sbt-buildinfo. */
case object BuildInfo {
  /** The value is "1.5.0+2-44650e3c-SNAPSHOT". */
  val version: String = "1.5.0+2-44650e3c-SNAPSHOT"
  override val toString: String = {
    "version: %s".format(
      version
    )
  }
}
// $COVERAGE-ON$

With error:

`_` is no longer supported for a wildcard import; use `*` instead
This construct can be rewritten automatically under -rewrite -source future-migration.

Note that adding the -rewrite -source future-migration flags fixes it, but the code should probably be generated correctly in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions