KT-2752: refactor NameSuggestion, change rules for determining name stability and applying mangling

This commit is contained in:
Alexey Andreev
2016-09-21 16:17:49 +03:00
parent 6f7e7d8504
commit 9c7c82b151
21 changed files with 190 additions and 273 deletions
@@ -14,11 +14,9 @@ internal open class A(val a: Int) {
internal class B(val b: Int) : A(b / 2) {
override fun foo(i: Int): String = "B.foo($i: Int)"
fun boo(): String = "B.boo()"
fun boo(i: String): String = "B.boo($i: String)"
fun bar(i: String): String = "B.bar($i: String)"
fun bar(): String = "B.bar()"
override fun baz(i: Int): String = "B.baz($i: Int)"
fun bar(d: Double): String = "B.bar($d: Double)"
}
@@ -33,12 +31,10 @@ fun box(): String {
if (b.foo(4) != "B.foo(4: Int)") return "b.foo(4) != \"B.foo(4: Int)\", it: ${b.foo(4)}"
if (b.boo(434) != "A.boo(434)") return "b.boo(434) != \"A.boo(434)\", it: ${b.boo(434)}"
if (b.boo() != "B.boo()") return "b.boo() != \"B.boo()\", it: ${b.boo()}"
if (b.boo("qlfj") != "B.boo(qlfj: String)") return "b.boo(\"qlfj\") != \"B.boo(qlfj: String)\", it: ${b.boo("qlfj")}"
if (b.bar("apl") != "B.bar(apl: String)") return "b.bar(\"apl\") != \"B.bar(apl: String)\", it: ${b.bar("apl")}"
if (b.baz(34) != "B.baz(34: Int)") return "b.baz(34) != \"B.baz(34: Int)\", it: ${b.baz(34)}"
if (b.bar() != "B.bar()") return "b.bar() != \"B.bar()\", it: ${b.bar()}"
if (b.bar(2.213) != "B.bar(2.213: Double)") return "b.bar(2.213) != \"B.bar(2.213: Double)\", it: ${b.bar(2.213)}"
val a: A = b