Skip to content

Commit 0a6755e

Browse files
committed
Rename annotation to main
I first thought there'd be a conflict with the current compiler-generated version, but there isn't after all.
1 parent e3b36a8 commit 0a6755e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/pos/main-method-scheme.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ end MainAnnotation
1818

1919
//Sample main class, can be freely implemented:
2020

21-
class _main(progName: String, args: Array[String], docComment: String) extends MainAnnotation:
21+
class main(progName: String, args: Array[String], docComment: String) extends MainAnnotation:
2222

2323
def this() = this("", Array(), "")
2424

@@ -102,7 +102,7 @@ class _main(progName: String, args: Array[String], docComment: String) extends M
102102
else
103103
true
104104
end done
105-
end _main
105+
end main
106106

107107
// Sample main method
108108

@@ -118,7 +118,7 @@ end myProgram
118118

119119
object add:
120120
def main(args: Array[String]) =
121-
val cmd = new _main("add", args, "Adds two numbers")
121+
val cmd = new main("add", args, "Adds two numbers")
122122
val arg1 = cmd.getArg[Int]("num", summon[cmd.ArgumentParser[Int]])
123123
val arg2 = cmd.getArg[Int]("inc", summon[cmd.ArgumentParser[Int]], Some(1))
124124
if cmd.done() then myProgram.add(arg1(), arg2())

0 commit comments

Comments
 (0)