mirror of https://github.com/sbt/sbt.git
allow java varargs main
http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.1.4
This commit is contained in:
parent
2ebf9f1a4a
commit
3f2133729b
|
|
@ -62,7 +62,7 @@ object Discovery
|
|||
}
|
||||
def isStringArray(vp: IndexedSeq[ParameterList]): Boolean = vp.length == 1 && isStringArray(vp(0).parameters)
|
||||
def isStringArray(params: Seq[MethodParameter]): Boolean = params.length == 1 && isStringArray(params(0))
|
||||
def isStringArray(p: MethodParameter): Boolean = p.modifier == ParameterModifier.Plain && isStringArray(p.tpe)
|
||||
def isStringArray(p: MethodParameter): Boolean = (p.modifier == ParameterModifier.Plain || p.modifier == ParameterModifier.Repeated) && isStringArray(p.tpe)
|
||||
def isStringArray(t: Type): Boolean = isParameterized(t, "scala.Array", "java.lang.String") // doesn't handle scala.this#Predef#String, should API phase dealias?
|
||||
|
||||
def isParameterized(t: Type, base: String, args: String*): Boolean = t match {
|
||||
|
|
@ -97,4 +97,4 @@ object Discovery
|
|||
}
|
||||
|
||||
def isUnit(t: Type): Boolean = named(t, "scala.Unit")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
public class A{
|
||||
public static void main(String... args){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> run
|
||||
Loading…
Reference in New Issue