Do not generate unnecessary super-call checks for functions with defaults

Such check should only be generated for a function in an open class

 #KT-11962 Fixed
This commit is contained in:
Alexander Udalov
2016-12-23 18:24:26 +03:00
parent 3d9c264d63
commit b4051c4577
8 changed files with 65 additions and 46 deletions
@@ -0,0 +1,17 @@
// KT-11962 Super call with default parameters check is generated for top-level function
fun foo(x: Int = 1) { }
class FinalClass {
fun bar(x: Int = 2) { }
}
object Object {
fun baz(x: Int = 3) { }
}
fun test() {
fun local(x: Int = 4) { }
}
// 0 ATHROW