# Assignment not allow in while expression?

**URL:** <https://discuss.kotlinlang.org/t/assignment-not-allow-in-while-expression/339>\
**Category:** Uncategorized\
**Created:** [January 5, 2013, 4:36am UTC](https://discuss.kotlinlang.org/t/assignment-not-allow-in-while-expression/339 "2013-01-05T04:36:08Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Tomsk](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@Tomsk](https://discuss.kotlinlang.org/u/Tomsk)\
**Post date:** [January 9, 2013, 8:26pm UTC](https://discuss.kotlinlang.org/t/assignment-not-allow-in-while-expression/339/6 "2013-01-09T20:26:16Z")

</div>

So File.forEachLine works for files .... but it doesn't work for all the BufferedReader cases ... for example,

val reader = BufferedReader(StringReader(someStringData))

or

val reader = BufferedReader(InputStreamReader(myInputStream))

So the extension for BufferedReader is still pretty useful 🙂

---

_[View the full topic](https://discuss.kotlinlang.org/t/assignment-not-allow-in-while-expression/339)._
