Inspectopedia Help

Mismatched return type

Reports method and block return values whose inferred types don't match the method's expected return type. The expected return type is taken from either of:

  • The RBS type signature

  • The Sorbet type signature

  • The YARD @return tag

Example:

# @return [Integer] def method 1.0 end

Inspection options

Option

Type

Default

Check nilability

Checkbox

true

Inspection Details

Available in:

Qodana for Ruby 2023.3, RubyMine 2023.3

Plugin:

Ruby, 233.SNAPSHOT

Last modified: 13 July 2023