Vasily Levchenko 81d77c39f4 IR: default parameter extension support
for code
```
fun Int.foo(a:Int, b:Int = a + 1, c:Int = a + b) = a + b +c

fun main(arg:Array<String>) {
  42.foo(0)
}
```
we generate IR representation corresponding to the following code
```
fun Int.foo(a:Int, b:Int, c:Int) = a + b +c

fun foo_default(a:Int, b:Int, c:Int, __mask__:Int, __receiver__:Int):Int {
    var tmpb:Int = 0
    if ((__mask__ and (1 shl 1)) != 0)
        tmpb = a + 1
    else
        tmpb = b
    var tmpc:Int = 0
    if ((__mask__ and (1 shl 2)) != 0)
        tmpc = a + tmpb
    else
        tmpc = c
    return __receiver__.foo(a, tmpb, tmpc)
}

fun main(arg:Array<String>) {
  foo_default(0, 0, 0, 6 /* (1 shl 1) | (1 shl 2)*/, 42)
}
```

NOTE: if call provides all arguents we don't emit call of _default function.
2017-01-13 13:42:02 +03:00
2016-12-29 16:07:43 +04:00
2016-10-27 13:52:00 +03:00
2017-01-13 12:03:38 +03:00
2016-10-07 14:14:00 +03:00
2017-01-09 12:29:17 +03:00
2016-10-27 13:52:00 +03:00
2016-10-27 13:52:00 +03:00
2016-12-07 13:47:21 +04:00

Kotlin-native backend

Download dependencies:

./gradlew dependencies:update

Then build the compiler:

./gradlew dist

After that you should be able to compile your programs like that:

./dist/bin/konanc hello.kt -o hello

For an optimized compilation use -opt:

./dist/bin/konanc hello.kt -o hello -opt

For more tests, use:

./gradlew backend.native:tests:run
S
Description
The Kotlin Programming Language.
Readme 2.1 GiB
Languages
Kotlin 79.9%
Java 10.4%
Swift 4.3%
C 2.8%
C++ 2.1%
Other 0.3%