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:
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
annotation class IntAnno
|
||||
annotation class StringAnno
|
||||
annotation class DoubleAnno
|
||||
|
||||
[IntAnno] val Int.extension: Int
|
||||
get() = this
|
||||
|
||||
[StringAnno] val String.extension: String
|
||||
get() = this
|
||||
|
||||
[DoubleAnno] val Double.extension: Int
|
||||
get() = 42
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
test.DoubleAnno() internal val jet.Double.extension: jet.Int
|
||||
internal fun jet.Double.<get-extension>(): jet.Int
|
||||
test.IntAnno() internal val jet.Int.extension: jet.Int
|
||||
internal fun jet.Int.<get-extension>(): jet.Int
|
||||
test.StringAnno() internal val jet.String.extension: jet.String
|
||||
internal fun jet.String.<get-extension>(): jet.String
|
||||
|
||||
internal final annotation class DoubleAnno : jet.Annotation {
|
||||
/*primary*/ public constructor DoubleAnno()
|
||||
}
|
||||
|
||||
internal final annotation class IntAnno : jet.Annotation {
|
||||
/*primary*/ public constructor IntAnno()
|
||||
}
|
||||
|
||||
internal final annotation class StringAnno : jet.Annotation {
|
||||
/*primary*/ public constructor StringAnno()
|
||||
}
|
||||
Reference in New Issue
Block a user