@@ -46,6 +46,8 @@ import Annotations.Annotation
46
46
* }
47
47
*/
48
48
object MainProxies {
49
+ private type DefaultValues = Map [Int , Tree [_]]
50
+ private type ParameterAnnotations = Vector [Option [Annotation ]]
49
51
50
52
def mainProxies (stats : List [tpd.Tree ])(using Context ): List [untpd.Tree ] = {
51
53
import tpd ._
@@ -54,7 +56,7 @@ object MainProxies {
54
56
* Compute the default values of the function. Since they cannot be infered anymore at this point
55
57
* of the compilation, they must be explicitely passed by [[mainProxy ]].
56
58
*/
57
- def defaultValues (scope : Tree , funSymbol : Symbol ): Map [ Int , Tree ] =
59
+ def defaultValues (scope : Tree , funSymbol : Symbol ): DefaultValues =
58
60
scope match {
59
61
case TypeDef (_, template : Template ) =>
60
62
template.body.flatMap((_ : Tree ) match {
@@ -68,7 +70,7 @@ object MainProxies {
68
70
}
69
71
70
72
/** Computes the list of main methods present in the code. */
71
- def mainMethods (scope : Tree , stats : List [Tree ]): List [(Symbol , Vector [ Option [ Annotation ]], Map [ Int , Tree ] , Option [Comment ])] = stats.flatMap {
73
+ def mainMethods (scope : Tree , stats : List [Tree ]): List [(Symbol , ParameterAnnotations , DefaultValues , Option [Comment ])] = stats.flatMap {
72
74
case stat : DefDef =>
73
75
val sym = stat.symbol
74
76
sym.annotations.filter(_.matches(defn.MainAnnot )) match {
@@ -98,7 +100,7 @@ object MainProxies {
98
100
}
99
101
100
102
import untpd ._
101
- def mainProxy (mainFun : Symbol , paramAnnotations : Vector [ Option [ Annotation ]] , defaultValues : Map [ Int , Tree ] , docComment : Option [Comment ])(using Context ): List [TypeDef ] = {
103
+ def mainProxy (mainFun : Symbol , paramAnnotations : ParameterAnnotations , defaultValues : DefaultValues , docComment : Option [Comment ])(using Context ): List [TypeDef ] = {
102
104
val mainAnnot = mainFun.getAnnotation(defn.MainAnnot ).get
103
105
def pos = mainFun.sourcePos
104
106
val mainArgsName : TermName = nme.args
0 commit comments