Skip to content

Commit fe79554

Browse files
Remove unnecessary code
1 parent 87eba09 commit fe79554

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

compiler/src/dotty/tools/dotc/ast/MainProxies.scala

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,13 @@ object MainProxies {
9999
def mainProxy(mainFun: Symbol, paramAnnotations: ParameterAnnotationss, defaultValueSymbols: DefaultValueSymbols, docComment: Option[Comment])(using Context): List[TypeDef] = {
100100
val mainAnnot = mainFun.getAnnotation(defn.MainAnnot).get
101101
def pos = mainFun.sourcePos
102-
val mainArgsName: TermName = nme.args
103102
val cmdName: TermName = Names.termName("cmd")
104103

105104
val documentation = new Documentation(docComment)
106105

107106
/** A literal value (Boolean, Int, String, etc.) */
108107
inline def lit(any: Any): Literal = Literal(Constant(any))
109108

110-
/** Some(value) */
111-
inline def some(value: Tree): Tree = Apply(ref(defn.SomeClass.companionModule.termRef), value)
112-
113109
/** () => value */
114110
def unitToValue(value: Tree): Tree =
115111
val anonName = nme.ANON_FUN
@@ -125,7 +121,7 @@ object MainProxies {
125121
def createArgs(mt: MethodType, cmdName: TermName): List[(Tree, ValDef)] =
126122
mt.paramInfos.zip(mt.paramNames).zipWithIndex.map {
127123
case ((formal, paramName), n) =>
128-
val argName = mainArgsName ++ n.toString
124+
val argName = nme.args ++ n.toString
129125

130126
val isRepeated = formal.isRepeatedParam
131127

@@ -213,7 +209,7 @@ object MainProxies {
213209
TypeTree(),
214210
Apply(
215211
Select(instanciateAnnotation(mainAnnot), defn.MainAnnot_command.name),
216-
Ident(mainArgsName) :: lit(mainFun.showName) :: lit(documentation.mainDoc) :: Nil
212+
Ident(nme.args) :: lit(mainFun.showName) :: lit(documentation.mainDoc) :: Nil
217213
)
218214
)
219215
var args: List[ValDef] = Nil
@@ -242,7 +238,7 @@ object MainProxies {
242238

243239
val run = Apply(Select(Ident(cmdName), defn.MainAnnotCommand_run.name), mainCall)
244240
val body = Block(cmd :: args, run)
245-
val mainArg = ValDef(mainArgsName, TypeTree(defn.ArrayType.appliedTo(defn.StringType)), EmptyTree)
241+
val mainArg = ValDef(nme.args, TypeTree(defn.ArrayType.appliedTo(defn.StringType)), EmptyTree)
246242
.withFlags(Param)
247243
/** Replace typed `Ident`s that have been typed with a TypeSplice with the reference to the symbol.
248244
* The annotations will be retype-checked in another scope that may not have the same imports.

library/src/scala/main.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import annotation._
1717
* displaying the help
1818
*/
1919
final class main(maxLineLength: Int) extends MainAnnotation:
20-
self =>
2120
import main._
2221
import MainAnnotation._
2322

0 commit comments

Comments
 (0)