Fix synthetic method generation for extension properties

If several annotated extension properties with the same name were declared in
one class, JVM issued a ClassFormatError, since we generated a synthetic method
for each of them with the same name and signature. Make the signature of this
synthetic method depend on a receiver parameter, if a property has one
This commit is contained in:
Alexander Udalov
2013-10-09 23:09:17 +04:00
parent 806d264771
commit 2445d04338
11 changed files with 114 additions and 4 deletions
@@ -0,0 +1,9 @@
annotation class Anno
[Anno] val Int.foo: Int
get() = this
[Anno] val String.foo: Int
get() = 42
fun box() = if (42.foo == 42 && "OK".foo == 42) "OK" else "Fail"