@@ -99,17 +99,13 @@ object MainProxies {
99
99
def mainProxy (mainFun : Symbol , paramAnnotations : ParameterAnnotationss , defaultValueSymbols : DefaultValueSymbols , docComment : Option [Comment ])(using Context ): List [TypeDef ] = {
100
100
val mainAnnot = mainFun.getAnnotation(defn.MainAnnot ).get
101
101
def pos = mainFun.sourcePos
102
- val mainArgsName : TermName = nme.args
103
102
val cmdName : TermName = Names .termName(" cmd" )
104
103
105
104
val documentation = new Documentation (docComment)
106
105
107
106
/** A literal value (Boolean, Int, String, etc.) */
108
107
inline def lit (any : Any ): Literal = Literal (Constant (any))
109
108
110
- /** Some(value) */
111
- inline def some (value : Tree ): Tree = Apply (ref(defn.SomeClass .companionModule.termRef), value)
112
-
113
109
/** () => value */
114
110
def unitToValue (value : Tree ): Tree =
115
111
val anonName = nme.ANON_FUN
@@ -125,7 +121,7 @@ object MainProxies {
125
121
def createArgs (mt : MethodType , cmdName : TermName ): List [(Tree , ValDef )] =
126
122
mt.paramInfos.zip(mt.paramNames).zipWithIndex.map {
127
123
case ((formal, paramName), n) =>
128
- val argName = mainArgsName ++ n.toString
124
+ val argName = nme.args ++ n.toString
129
125
130
126
val isRepeated = formal.isRepeatedParam
131
127
@@ -213,7 +209,7 @@ object MainProxies {
213
209
TypeTree (),
214
210
Apply (
215
211
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
217
213
)
218
214
)
219
215
var args : List [ValDef ] = Nil
@@ -242,7 +238,7 @@ object MainProxies {
242
238
243
239
val run = Apply (Select (Ident (cmdName), defn.MainAnnotCommand_run .name), mainCall)
244
240
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 )
246
242
.withFlags(Param )
247
243
/** Replace typed `Ident`s that have been typed with a TypeSplice with the reference to the symbol.
248
244
* The annotations will be retype-checked in another scope that may not have the same imports.
0 commit comments