# Type unstable function because same variable name used twice

**URL:** <https://discourse.julialang.org/t/type-unstable-function-because-same-variable-name-used-twice/58810>\
**Category:** General Usage\
**Tags:** type, code\_warntype\
**Created:** [April 8, 2021, 8:54am UTC](https://discourse.julialang.org/t/type-unstable-function-because-same-variable-name-used-twice/58810 "2021-04-08T08:54:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [April 8, 2021, 5:31pm UTC](https://discourse.julialang.org/t/type-unstable-function-because-same-variable-name-used-twice/58810/5 "2021-04-08T17:31:47Z")

</div>

This type of “type instability” has no impact on performance and the compiler is smart enough to not have a problem with it.

The printer for `code_warntype` could be a bit smarter perhaps.

Feel free to reassign variables in functions as you wish. It is only a problem if the variable doesn’t get properly inferred at some place where it is used in the function.

---

_[View the full topic](https://discourse.julialang.org/t/type-unstable-function-because-same-variable-name-used-twice/58810)._
