Skip to content

Commit 492fc22

Browse files
Quick clean up of MainProxies
1 parent ff4e8ca commit 492fc22

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ object MainProxies {
8585
report.error(s"method cannot have multiple main annotations", mainAnnot.tree)
8686
Nil
8787
}
88-
case stat @ TypeDef(name, impl: Template) if stat.symbol.is(Module) =>
88+
case stat @ TypeDef(_, impl: Template) if stat.symbol.is(Module) =>
8989
mainMethods(stat, impl.body)
9090
case _ =>
9191
Nil
@@ -144,8 +144,6 @@ object MainProxies {
144144
// The ParameterInfos to be passed to the arg getter
145145
val parameterInfos = {
146146
val param = paramName.toString
147-
val paramInfosName = argName ++ "paramInfos"
148-
val paramInfosIdent = Ident(paramInfosName)
149147
val paramInfosTree = New(
150148
AppliedTypeTree(TypeTree(defn.MainAnnotParameterInfos.typeRef), List(TypeTree(formalType))),
151149
// Arguments to be passed to ParameterInfos' constructor
@@ -196,7 +194,7 @@ object MainProxies {
196194
def extractArgs(args: List[tpd.Tree]): List[Tree] =
197195
args.flatMap {
198196
case Typed(SeqLiteral(varargs, _), _) => varargs.map(arg => TypedSplice(arg))
199-
case arg @ Select(_, name) => if name.is(DefaultGetterName) then List() else List(TypedSplice(arg))
197+
case arg @ Select(_, name) if name.is(DefaultGetterName) => List() // Ignore default values, they will be added later by the compiler
200198
case arg => List(TypedSplice(arg))
201199
}
202200

0 commit comments

Comments
 (0)