Some inline tests that do not work
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
|
||||
fun <caret>sqr(x: Double) = x * x
|
||||
|
||||
class Point(val x: Double, val y: Double) {
|
||||
// After sqr inlining, only first usage of sqr is replaced
|
||||
fun distance(other: Point) = Math.sqrt(sqr(x - other.x) + sqr(y - other.y))
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Point(val x: Double, val y: Double) {
|
||||
// After sqr inlining, only first usage of sqr is replaced
|
||||
fun distance(other: Point): Double {
|
||||
val x = x - other.x
|
||||
// See KT-17022
|
||||
return Math.sqrt(x * x + sqr(y - other.y))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user