`NoMethodError location for "":String` in `on_regexp_add`
vinistock opened this issue · comments
I don't know what Ruby code triggers this error, but we caught it in the Ruby LSP's telemetry. It appears that part
is an empty string and then invoking location
on it breaks.
Happens on this line
syntax_tree/lib/syntax_tree/parser.rb
Line 3137 in 9129486
Oh man I would love to know what triggered this. It is almost definitely a syntax error that is passing an unexpected type up the tree somehow. I'll see if I can replicate, but without the source I don't really know.
Okay, I totally believe you, but I cannot figure out a way to reproduce this at all. If you find the original source that did this, I can 100% fix it, but I don't want to add a type check unless I can add a test as well. I'm going to close for now since there's nothing really either of us can do.