Skip to content

Gem depends on #inspect producing valid Ruby code #972

Description

@ngollan

Trying to produce shorter/prettier (no accounting for taste) inspect output and overriding TrueClass/FalseClass#inspect breaks "optimisation" with something like:

undefined local variable or method `⊤' for #<Haml::AttributeCompiler:0x007f1a0304c648>

in Haml::AttributeCompiler#static_build.

I have true/false represented by "⊤" and "⊥" via

TrueClass.class_eval do
  def inspect
    "⊤"
  end
end

FalseClass.class_eval do
  def inspect
    "⊥"
  end
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions