Files
codegraph/__tests__
Colby MchenryandClaude Opus 5.5 8410db42a1 fix(scala): block-local vals, package imports and package objects (#2193)
- A `val` the graph files under a class but that is written inside a block
  of its body (cats' `test("…") { val f = … }`) is that block's alone. It
  took `f(…)` calls from lambda parameters in other suites and from cats'
  core library (`FreeT::FlatMapped::f` from option.scala, Invariant.scala…).
  A `val`/`const` declared inside a function's lines is likewise local
  (outside C/C++, whose nesting is not trusted; a Lua global stays global).
- In a class body with no enclosing method, a binder (a lambda parameter, a
  `val`) counts as local only inside a block still open at the site.
- Only an import rooted at a value (`import builder._`) lets any type's
  members in; a lowercase package path (`import cats.syntax.all._`) did too.
- An imported object's supertypes are in scope, and `package object x
  extends Api` (no node in the graph) is read from source - imported, or the
  file's own package: sttp's `multipart(...)`, `asJson(...)`, `asEither(...)`.

cats -478 +63, sttp -153 +81 (sampled losses: other tests' locals, scalatest
`test`/`eventually`, libc `free`, `sttp.model.Header`). fs2, http4s, okio,
koin, Exposed, lodash, excalidraw, flask, kong, jekyll, halo unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 19:15:47 +00:00
..