# An error I don't understand

**URL:** <https://forum.crystal-lang.org/t/an-error-i-dont-understand/3040>\
**Category:** Help & Support\
**Created:** [March 17, 2021, 4:13pm UTC](https://forum.crystal-lang.org/t/an-error-i-dont-understand/3040 "2021-03-17T16:13:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leximatica](https://avatars.discourse-cdn.com/v4/letter/l/90ced4/32.png) [@Leximatica](https://forum.crystal-lang.org/u/Leximatica)\
**Post date:** [March 17, 2021, 4:13pm UTC](https://forum.crystal-lang.org/t/an-error-i-dont-understand/3040/1 "2021-03-17T16:13:02Z")

</div>

Run this is playground and all seems well:

s = “”  
(s = “123”).size  
s.size

Omit (or comment out) the first line (s = “”) and a strange error occurs:

(s = “123”).size  
s.size

# Bug

You’ve reached a bug in the playground. Please [let us know](https://github.com/crystal-lang/crystal/issues/new) about it.

## Code

(s = “123”).size s.size

## Exception

error in line 4 Error: instantiating ‘Crystal::Playground::Agent#i(Int32)’ error in line 4 Error: instantiating ‘Crystal::Playground::Agent#i(Int32)’ error in line 5 Error: undefined local variable or method ‘s’ for top-level Did you mean ‘p’?

The “let us know” takes me to “GitHub” where I’m expected to have an account. I don’t use Github, because it is owned by Microsoft.

Anyway, this seems like some kind of error in Crystal or something.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [March 17, 2021, 4:26pm UTC](https://forum.crystal-lang.org/t/an-error-i-dont-understand/3040/2 "2021-03-17T16:26:40Z")

</div>

> [@Leximatica](#):
>
> Anyway, this seems like some kind of error in Crystal or something.

Yes, this is an issue with the playground specifically and has been reported as [Playground crashes when accessing variable assigned in the previous line in an assignment expression. · Issue #7091 · crystal-lang/crystal · GitHub](https://github.com/crystal-lang/crystal/issues/7091).

---

<div class="post-metadata">

**Author:** ![Leximatica](https://avatars.discourse-cdn.com/v4/letter/l/90ced4/32.png) [@Leximatica](https://forum.crystal-lang.org/u/Leximatica)\
**Post date:** [March 17, 2021, 8:24pm UTC](https://forum.crystal-lang.org/t/an-error-i-dont-understand/3040/3 "2021-03-17T20:24:44Z")

</div>

Good to know others have found/reported this issue as well.  
Thank you for responding. My excitement for Crystal 1.0 could not be greater.
