Add test for issue KT-23582

This commit is contained in:
Roman Artemev
2018-04-06 15:41:43 +03:00
parent 2bea8816a6
commit 4cdd121c21
12 changed files with 104 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
$TESTDATA_DIR$/separateModules/sepModule1.kt
-meta-info
-output
$TEMP_DIR$/m1/m.js
---
$TESTDATA_DIR$/separateModules/sepModule2.kt
-libraries
$TEMP_DIR$/m1
-output
$TEMP_DIR$/m2/m.js
+2
View File
@@ -0,0 +1,2 @@
warning: module "m" depends from module with the same name
OK
+1
View File
@@ -0,0 +1 @@
// NOT_CONTAINS: m2/m.js, foo(bar$lambda);
@@ -0,0 +1,10 @@
$TESTDATA_DIR$/separateModules/sepModule3.kt
-meta-info
-output
$TEMP_DIR$/m3/m.js
---
$TESTDATA_DIR$/separateModules/sepModule4.kt
-libraries
$TEMP_DIR$/m3
-output
$TEMP_DIR$/m4/m.js
@@ -0,0 +1,2 @@
warning: module "m" depends from module with the same name
OK
@@ -0,0 +1 @@
// NOT_CONTAINS: m4/m.js, foofaa();
@@ -0,0 +1,6 @@
package m1
inline fun foo(action: () -> Int): Int {
return action()
}
+13
View File
@@ -0,0 +1,13 @@
package m2
import m1.*
fun bar(): Int {
foo { return 100 }
return -99
}
fun box(): String {
if (bar() == 100) return "OK"
return "fail"
}
+10
View File
@@ -0,0 +1,10 @@
package m3
fun foofaa(): Unit { }
inline fun foo(action: () -> Int): Int {
foofaa()
return action()
}
+17
View File
@@ -0,0 +1,17 @@
package m4
import m3.*
inline fun foo(action: () -> Int): Int {
return action()
}
fun bar(): Int {
foo { return 100 }
return -99
}
fun box(): String {
if (bar() == 100) return "OK"
return "fail"
}