File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/dotty/tools/backend/jvm Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,22 @@ class CollectEntryPoints extends MiniPhaseTransform {
48
48
}
49
49
50
50
object CollectEntryPoints {
51
+ def isJavaMainMethod (sym : Symbol )(implicit ctx : Context ) = {
52
+ val d = ctx.definitions
53
+ val StringType = d.StringType
54
+
55
+ (sym.name == nme.main) && (sym.info match {
56
+ case r@ MethodType (_, List (d.ArrayType (t))) =>
57
+ (t.widenDealias =:= StringType ) && (
58
+ r.resultType.widenDealias =:= d.UnitType )
59
+ case _ => false
60
+ })
61
+ }
62
+
51
63
def isJavaEntyPoint (sym : Symbol )(implicit ctx : Context ): Boolean = {
52
64
import Types .MethodType
53
65
val d = ctx.definitions
54
66
val StringType = d.StringType
55
- def isJavaMainMethod (sym : Symbol ) = (sym.name == nme.main) && (toDenot(sym).info match {
56
- case r@ MethodType (_, List (d.ArrayType (StringType ))) => r.resultType eq d.UnitType
57
- case _ => false
58
- })
59
67
// The given class has a main method.
60
68
def hasJavaMainMethod (sym : Symbol ): Boolean =
61
69
(toDenot(sym).info member nme.main).alternatives exists(x => isJavaMainMethod(x.symbol))
You can’t perform that action at this time.
0 commit comments