solargraph icon indicating copy to clipboard operation
solargraph copied to clipboard

At alpha typechecking level, warn on method calls off of nilable types

Open apiology opened this issue 10 months ago • 1 comments

Require that all unique types of a complex type offer the same method before it can match when "loose unions" mode is turned off.

Depends on:

  • #1012

Included to fix build:

  • https://github.com/castwide/solargraph/pull/1120

apiology avatar Mar 20 '25 21:03 apiology

Realistically, there's enough return if foo.nil? code out there that this will probably have to wait until we have flow-sensitive typing. If that end up being difficult, I may propose hiding this under a --level={alpha,beta} level or somesuch. Long term we may want a flag to turn on new checks introduced between major releases, to help keep folks from being broken when we introduce things? Not sure.

apiology avatar Mar 21 '25 13:03 apiology