Skip to content

Add main function using DelayedInit (extends App) #174

Description

@olafurpg

See https://github.com/lampepfl/dotty/blob/836ec499de1d8f52de6786f6090aeb52dd128218/docs/docs/reference/dropped/delayedInit.md and scala/scala3#559

// before
object DelayedInitToMain extends App {
  println(args)
}
// after
object DelayedInitToMain {
  def main(args: Array[String]): Unit = {
    println(args)
  }
}

The rewrite should only trigger if args is accessed.

Note scalameta/scalameta#905

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions