# Companion object after upgrade from M14 to 1.0Beta

**URL:** <https://discuss.kotlinlang.org/t/companion-object-after-upgrade-from-m14-to-1-0beta/61>\
**Category:** Uncategorized\
**Created:** [October 22, 2015, 7:10pm UTC](https://discuss.kotlinlang.org/t/companion-object-after-upgrade-from-m14-to-1-0beta/61 "2015-10-22T19:10:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![crkt\_infakt](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@crkt\_infakt](https://discuss.kotlinlang.org/u/crkt_infakt)\
**Post date:** [October 22, 2015, 7:10pm UTC](https://discuss.kotlinlang.org/t/companion-object-after-upgrade-from-m14-to-1-0beta/61/1 "2015-10-22T19:10:51Z")

</div>

All happens on android device running lollipop but I presume, it's applicable on "normal" JVM as well.

```kotlin
// KOTLIN
 interface IStatic
open class Static(x: IStatic) {
  fun doSth(){}
}
class ConcreteWithStatic : IStatic {
  companion object : Static(ConcreteWithStatic())
}

```

`
Run this in a way that kotlin part is run before java's
`

```kotlin
// KOTLINConcreteWithStatic.doSth()

// JAVA
// must be executed after Kotlin's code with doSth()
ConcreteWithStatic.Companion.doSth(); //crashes as here ConcreteWithStatic.Companion is null

```

`
If there was no execution of doSth() in Kotlin preceeding Java execution, everything works seemlessly. If doSth() in Kotlin was executed before! Java's code, Java sees companion object as null`

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [October 23, 2015, 5:04pm UTC](https://discuss.kotlinlang.org/t/companion-object-after-upgrade-from-m14-to-1-0beta/61/2 "2015-10-23T17:04:37Z")

</div>

Thanks for the report, this issue will be fixed ASAP

---

<div class="post-metadata">

**Author:** ![crkt\_infakt](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@crkt\_infakt](https://discuss.kotlinlang.org/u/crkt_infakt)\
**Post date:** [October 26, 2015, 9:03am UTC](https://discuss.kotlinlang.org/t/companion-object-after-upgrade-from-m14-to-1-0beta/61/3 "2015-10-26T09:03:53Z")

</div>

awesome :)&nbsp;&nbsp;can't wait
