/(?<foo>foo)/ =~ bar ^^^^^^^^^^^^^^^^^^^^
class << self; end ^^^^^^^^^^^^^^^^^^
foo.bar, = 1 ^^^^^^^
If a class variable is written within a method definition, it has a different type than everywhere else.
/(?<foo>foo)/ =~ bar ^^^^^^^^^^^^^^^^^^^^
class << self; end ^^^^^^^^^^^^^^^^^^