# Codegen Error with arrayOfNulls and Stream.toArray

**URL:** <https://discuss.kotlinlang.org/t/codegen-error-with-arrayofnulls-and-stream-toarray/21801>\
**Category:** Support\
**Created:** [May 12, 2021, 3:11am UTC](https://discuss.kotlinlang.org/t/codegen-error-with-arrayofnulls-and-stream-toarray/21801 "2021-05-12T03:11:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![MelnCat](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@MelnCat](https://discuss.kotlinlang.org/u/MelnCat)\
**Post date:** [May 12, 2021, 3:11am UTC](https://discuss.kotlinlang.org/t/codegen-error-with-arrayofnulls-and-stream-toarray/21801/1 "2021-05-12T03:11:59Z")

</div>

Hey there, I was developing an application in kotlin, when suddenly it failed to compile and spat out an exceedingly long error. I managed to find out which part of it caused the error, and I was wondering why it would have caused an error.  
Here’s the code:

```nohighlight
listOf(1).stream().toArray<Int>(::arrayOfNulls)

```

---

_[View the full topic](https://discuss.kotlinlang.org/t/codegen-error-with-arrayofnulls-and-stream-toarray/21801)._
