Skip to content

Uppercase instance or class variables #14093

@HertzDevil

Description

@HertzDevil

It is in fact possible to define instance or class variables whose name starts with an uppercase letter:

class Foo
  @A = 1
  @@B = 2

  def foo
    @A + @@B
  end
end

Foo.new.foo # => 3

The same holds for Ruby as well. However, this is causing codegen problems for us, such as in #7865.

Should we deprecate this syntax or do we accept it as valid?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions