Inspectopedia Help

Literal class referenced

Reports references to the classes NilClass, TrueClass, and FalseClass in type signatures. Usage of these classes is unnecessarily verbose.

A quick fix is available to replace the NilClass, TrueClass, or FalseClass usage with its respective literal.


# 'NilClass' referenced instead of 'nil', ... type example = NilClass | TrueClass | FalseClass

After the quick fix:

type example = nil | true | false

Inspection Details

By default bundled with:

Qodana for Ruby 2024.1, RubyMine 2024.1,

Can be installed with plugin:

Ruby, 241.SNAPSHOT

Last modified: 29 April 2024