Simplify type mapping logic in CodegenBinding

- inline asmType to calling getAsmType, which does something more
- refactor getJvmInternalName to use getAsmType as well
- simplify getAsmType and fix a probable bug in mapping singletons nested in
  enums (which wasn't reproduced, though a test is added)
- delete unnnecessary ASM_TYPE recording for enum entries in
  CodegenAnnotatingVisitor
This commit is contained in:
Alexander Udalov
2014-05-07 14:15:29 +04:00
parent 372bf17982
commit 3a0aac4857
4 changed files with 35 additions and 34 deletions
@@ -0,0 +1,20 @@
enum class E {
ENTRY
SUBCLASS {
object O {
fun foo() = 2
}
override fun bar() = O.foo()
}
object O {
fun foo() = 1
}
open fun bar() = O.foo()
}
fun box(): String {
if (E.ENTRY.bar() != 1) return "Fail 1"
if (E.SUBCLASS.bar() != 2) return "Fail 2"
return "OK"
}