81d77c39f4e35f64e4b8649f1b6236fe1503507e
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.
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
Description
Languages
Kotlin
79.9%
Java
10.4%
Swift
4.3%
C
2.8%
C++
2.1%
Other
0.3%