# Analyzer skips an obvious error and application crashes in a runtime

**URL:** <https://discuss.kotlinlang.org/t/analyzer-skips-an-obvious-error-and-application-crashes-in-a-runtime/12226>\
**Category:** Language Design\
**Created:** [April 4, 2019, 12:18pm UTC](https://discuss.kotlinlang.org/t/analyzer-skips-an-obvious-error-and-application-crashes-in-a-runtime/12226 "2019-04-04T12:18:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evgepic](https://avatars.discourse-cdn.com/v4/letter/e/f475e1/32.png) [@evgepic](https://discuss.kotlinlang.org/u/evgepic)\
**Post date:** [April 4, 2019, 12:18pm UTC](https://discuss.kotlinlang.org/t/analyzer-skips-an-obvious-error-and-application-crashes-in-a-runtime/12226/1 "2019-04-04T12:18:37Z")

</div>

Hello everyone. I wrote a topic about unexpected analyzer behavior yesterday. The topic describes about unexpected behavior of the Kotlin code analyzer when i use Realm library.

> [@Kotlin and Realm unexpected behavior](https://discuss.kotlinlang.org/t/kotlin-and-realm-unexpected-behavior/12214):
>
> Hello everyone, i have got a situation when Android Studio allows me to compile this code. Is this behavior right? And can someone explain me how does it work?

After discuss, I started investigate this problem more deeper and now I’ve got a lot of questions and suspicions. Now Realm library doesn’t affect to the problem, and this problem became only language specific. Please, look at the images below.

![f](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/e/ef88cb2e42221cc44d956e47e890ff7757f46ed5.png)

![s](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/c/ce90d6cca3462acf57d49419cb76ffedd6a81991.png)  
On this line i’ve got “The spread operator (\*foo) may not be applied to an argument of nullable type” error.

![t](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/8/804f7dfb941527812ea9bb3cd4497c9c0d20798b.png)  
The same error’s here.

![f](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/c/c120c2e15feeb24a11ca9a05b4d8aa814e982e6c.png)  
And here’s no error. This line crashes an application in a runtime with a NPE when a JVM tries to get a length of the array.  
I’ve got a 1.3.10 Kotlin release and got the same behavior with 1.3.20.  
Thanks for attention.

---

<div class="post-metadata">

**Author:** ![Alexey.Belkov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/alexey.belkov/32/5215_2.png) [@Alexey.Belkov](https://discuss.kotlinlang.org/u/Alexey.Belkov)\
**Post date:** [April 4, 2019, 2:35pm UTC](https://discuss.kotlinlang.org/t/analyzer-skips-an-obvious-error-and-application-crashes-in-a-runtime/12226/2 "2019-04-04T14:35:01Z")

</div>

Reproduced only with the [experimental new inference](https://discuss.kotlinlang.org/t/new-type-inference-in-kotlin-1-3-0-rc-190/9914) and reported [https://youtrack.jetbrains.com/issue/KT-30808](https://youtrack.jetbrains.com/issue/KT-30808). If you feel that your case is actually different, please file a separate issue at [http://kotl.in/issue](http://kotl.in/issue). Thanks.
