fix main function detection to rely on actually resolved types

This commit is contained in:
Ladislav Thon
2014-02-16 02:24:17 +01:00
committed by Evgeny Gerashchenko
parent a2f6b99862
commit 36bc7580aa
21 changed files with 242 additions and 84 deletions
@@ -0,0 +1,5 @@
package Hello
fun main(args: kotlin.Array<kotlin.String>) {
System.out.println("Hello from fully qualified main!")
}
@@ -0,0 +1,4 @@
OUT:
Hello from fully qualified main!
Return code: 0
@@ -0,0 +1,5 @@
package Hello
fun main(vararg args: kotlin.String) {
System.out.println("Hello from vararg main!")
}
@@ -0,0 +1,4 @@
OUT:
Hello from vararg main!
Return code: 0
@@ -0,0 +1,10 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -0,0 +1,7 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call"/>
</target>
</project>
@@ -0,0 +1,9 @@
package foo
var ok = "FAIL"
fun main(args: kotlin.Array<kotlin.String>) {
ok = "OK"
}
fun box(): String = ok
@@ -0,0 +1,10 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -0,0 +1,7 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call"/>
</target>
</project>
@@ -0,0 +1,9 @@
package foo
var ok = "FAIL"
fun main(vararg args: kotlin.String) {
ok = "OK"
}
fun box(): String = ok