Fix bridge generation for special builtin override

Use method itself signature as common bridge delegate

 #KT-11285 Fixed
This commit is contained in:
Denis Zharkov
2016-03-04 16:45:52 +03:00
parent 11f05005f6
commit 68f411395a
4 changed files with 56 additions and 12 deletions
@@ -0,0 +1,26 @@
import java.util.*
open class Base<Target : DatabaseEntity>() : HashSet<Target>() {
override fun remove(element: Target): Boolean {
return true
}
}
class Derived : Base<Issue>() {
// common "synthetic bridge override fun remove(element: DatabaseEntity): Boolean" should call
// `INVOKEVIRTUAL remove(Issue)`
// instead of `INVOKEVIRTUAL remove(OBJECT)`
override fun remove(element: Issue): Boolean {
return super.remove(element)
}
}
open class DatabaseEntity
class Issue: DatabaseEntity()
fun box(): String {
val sprintIssues = Derived()
if (!sprintIssues.remove(Issue())) return "Fail"
return "OK"
}