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 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.