File tree Expand file tree Collapse file tree 5 files changed +90
-119
lines changed Expand file tree Collapse file tree 5 files changed +90
-119
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,3 @@ allprojects {
2828 maven { url " https://kotlin.bintray.com/kotlinx" }
2929 }
3030}
31-
32- task clean (type : Delete ) {
33- delete rootProject. buildDir
34- }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import org.gradle.internal.impldep.org.apache.maven.Maven
2+
3+ plugins {
4+ kotlin(" multiplatform" )
5+ `maven- publish`
6+ }
7+
8+
9+ repositories {
10+ mavenCentral()
11+ }
12+
13+ kotlin {
14+ targets {
15+ jvm()
16+ js {
17+ browser()
18+ nodejs()
19+ }
20+ linuxX64()
21+ linuxArm32Hfp()
22+ macosX64()
23+ mingwX64()
24+ iosArm64()
25+ iosArm32()
26+ iosX64()
27+ }
28+ sourceSets {
29+ commonTest {
30+ kotlin.srcDir(" src/test/kotlin" )
31+ }
32+ }
33+ }
34+
35+ dependencies {
36+ commonMainImplementation(" org.jetbrains.kotlin:kotlin-stdlib" )
37+ commonTestImplementation(" org.jetbrains.kotlin:kotlin-test-annotations-common" )
38+ commonTestImplementation(" org.jetbrains.kotlin:kotlin-test-common" )
39+
40+ " jvmMainImplementation" (" org.jetbrains.kotlin:kotlin-stdlib" )
41+ " jvmTestImplementation" (" org.jetbrains.kotlin:kotlin-test-junit" )
42+
43+ " jsMainImplementation" (" org.jetbrains.kotlin:kotlin-stdlib-js" )
44+ " jsTestImplementation" (" org.jetbrains.kotlin:kotlin-test-js" )
45+ }
Original file line number Diff line number Diff line change 1+ import kotlin.test.Test
2+ import kotlin.test.fail
3+
4+ typealias Dispatch = (Any ) -> Any
5+ typealias GetState = () -> Any
6+ typealias Thunk = (Dispatch , GetState , Any? ) -> Any
7+
8+ data class AppState (val string : String )
9+
10+ val dispatch: Dispatch = { }
11+ val getState: GetState = { AppState (" myState" ) }
12+
13+ fun myThunk (dispatch : Dispatch , getState : GetState , arg : Any? ) {
14+ println (" Inside thunk" )
15+ }
16+
17+
18+ fun multiParamFunctionTest (foo : Any ) {
19+ if (foo is Function <* >) {
20+ (foo as Thunk )(dispatch, getState, null )
21+ } else {
22+ fail()
23+ }
24+ }
25+
26+
27+ /* *
28+ * Demonstrates bug with `is Function<*>. Passes on JVM & Native, fails on JS
29+ */
30+ class FunctionCheckTest {
31+
32+
33+ @Test
34+ fun passIsCheck () {
35+ if ({ str: String -> } is Function <* >) {
36+ } else {
37+ fail(" Function not recognized in `is Function<*>`" )
38+ }
39+ }
40+
41+ @Test
42+ fun typeAliasCheck () {
43+ multiParamFunctionTest(::myThunk)
44+ }
45+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments