Faisal01011 and Claude
e293b64f6e
fix(extract): resolve Scala context bounds to references edges ( #2046 )
...
`def sort[A: Ordering]` desugars to an implicit `Ordering[A]`, so a context
bound is a real dependency the function has on that typeclass -- and the
idiomatic form is more common in modern Scala than the desugared
`(implicit ...)` it compiles to. `context_bound` was not referenced anywhere
in the extractor, so the dependency was invisible wherever it appeared.
Two grammar shapes drive the implementation, both verified against
tree-sitter-scala 0.26.0 before writing the fix:
- `context_bound` is a direct child of `type_parameters`, one per bound, so
the walk belongs in the existing per-function Scala block and needs no new
handler.
- A higher-kinded parameter nests a further `type_parameters` for its own arity
brackets (`def program[F[_]: Async: Temporal]`), so the walk recurses rather
than reading direct children only -- otherwise both bounds on `program` are
missed.
`upper_bound` (`[T <: Comparable[T]]`) is a distinct node type and is
deliberately not matched: a subtype constraint is not a dependency, so an edge
there would assert something the source does not say. Bounds also get their
own `type_bound` context rather than reusing `parameter_type`, so a consumer
can tell a typeclass constraint from a parameter annotation.
One trap worth recording, because the neighbouring code invites it:
`type_parameters` and `parameters` carry the *same* field name on
`function_definition`, so `child_by_field_name("parameters")` returns whichever
comes first. The bounds are therefore located by node type, never by field
name -- a field lookup would read the function's real parameters as bounds. A
regression test pins that `xs: List[A]` still resolves under `parameter_type`
and never under `type_bound`.
Verified:
- uv run pytest tests/test_scala_context_bounds.py -q (10 passed)
- 6 of the 10 new tests fail on the pre-fix tree
- uv run pytest tests/ -q -> 28 failed, 6164 passed, 101 skipped; the 28
failures are byte-identical to the clean-tree baseline and none touch Scala
- uv run ruff check . -> clean
- uv run pyright -> 635 errors, identical to the clean-tree baseline
Co-Authored-By: Claude <noreply@anthropic.com >
2026-10-03 20:27:11 +05:30
..
2026-09-21 19:19:26 +01:00
2026-07-15 15:09:17 +01:00
2026-09-10 23:04:40 +01:00
2026-08-15 17:16:53 +01:00
2026-09-30 20:41:10 +01:00
2026-07-30 17:13:48 +01:00
2026-08-13 14:17:41 +01:00
2026-08-12 20:57:39 +01:00
2026-09-30 20:41:10 +01:00
2026-07-26 11:52:20 +01:00
2026-09-05 01:18:59 +01:00
2026-09-05 01:18:59 +01:00
2026-09-12 17:36:09 +01:00
2026-09-10 23:04:40 +01:00
2026-09-12 22:23:00 +01:00
2026-07-27 10:46:47 +01:00
2026-08-12 14:20:21 +01:00
2026-09-29 13:49:39 +01:00
2026-09-11 22:46:15 +01:00
2026-10-02 17:10:08 +01:00
2026-08-06 17:29:18 +01:00
2026-09-21 19:44:17 +01:00
2026-09-12 17:36:09 +01:00
2026-08-06 17:29:18 +01:00
2026-09-22 15:00:07 +01:00
2026-09-22 14:58:22 +01:00
2026-09-11 22:51:35 +01:00
2026-07-16 23:48:07 +01:00
2026-07-15 13:13:30 +01:00
2026-09-05 21:55:34 +01:00
2026-07-18 19:07:16 +01:00
2026-09-17 11:01:38 +01:00
2026-08-29 19:32:51 +01:00
2026-09-30 20:41:10 +01:00
2026-09-14 18:55:31 +01:00
2026-09-25 15:44:08 +01:00
2026-07-18 19:07:16 +01:00
2026-08-05 22:08:29 +01:00
2026-08-18 16:02:02 +01:00
2026-10-02 17:10:07 +01:00
2026-09-30 20:16:06 +01:00
2026-10-02 17:10:07 +01:00
2026-09-27 18:56:31 +01:00
2026-07-18 12:04:23 +01:00
2026-09-13 17:47:56 +01:00
2026-09-02 14:58:01 +01:00
2026-08-24 14:12:53 +01:00
2026-10-02 16:50:45 +01:00
2026-08-25 15:45:06 +01:00
2026-08-21 16:50:25 +01:00
2026-09-09 11:30:27 +01:00
2026-08-24 13:22:09 +01:00
2026-10-02 16:50:45 +01:00
2026-08-24 14:08:25 +01:00
2026-08-24 13:17:23 +01:00
2026-08-05 01:41:12 +01:00
2026-09-27 18:39:52 +01:00
2026-09-25 16:01:47 +01:00
2026-09-07 20:21:35 +01:00
2026-08-17 15:35:53 +01:00
2026-09-25 16:01:47 +01:00
2026-09-26 13:53:08 +01:00
2026-09-02 03:05:59 +01:00
2026-10-02 17:10:08 +01:00
2026-09-28 10:15:38 +01:00
2026-08-29 18:38:33 +01:00
2026-09-05 01:18:59 +01:00
2026-09-16 15:37:30 +01:00
2026-10-02 16:50:45 +01:00
2026-07-17 00:09:02 +01:00
2026-09-11 23:58:31 +01:00
2026-08-20 16:09:00 +01:00
2026-09-23 16:54:04 +01:00
2026-08-14 14:26:12 +01:00
2026-09-29 13:49:39 +01:00
2026-09-16 16:20:01 +01:00
2026-08-21 19:21:20 +01:00
2026-08-28 01:20:57 +01:00
2026-09-23 19:45:40 +01:00
2026-09-29 13:49:39 +01:00
2026-08-27 20:20:16 +01:00
2026-07-20 16:35:14 +01:00
2026-09-30 20:10:34 +01:00
2026-09-05 21:55:33 +01:00
2026-09-10 14:03:22 +01:00
2026-08-25 18:09:25 +01:00
2026-07-30 17:13:48 +01:00
2026-09-22 14:58:12 +01:00
2026-09-22 14:58:12 +01:00
2026-08-16 18:35:46 +01:00
2026-07-20 15:35:40 +01:00
2026-09-02 14:49:03 +01:00
2026-09-30 20:41:10 +01:00
2026-08-28 01:20:27 +01:00
2026-07-27 10:46:47 +01:00
2026-09-06 16:17:37 +01:00
2026-08-30 15:11:40 +01:00
2026-10-02 17:10:07 +01:00
2026-08-19 14:05:58 +01:00
2026-07-18 19:07:16 +01:00
2026-09-30 20:41:10 +01:00
2026-08-05 22:08:29 +01:00
2026-08-05 22:08:29 +01:00
2026-08-16 18:28:53 +01:00
2026-08-17 19:00:46 +01:00
2026-08-17 15:40:19 +01:00
2026-08-18 22:20:19 +01:00
2026-07-20 11:29:22 +01:00
2026-09-05 21:55:33 +01:00
2026-07-25 22:53:43 +01:00
2026-08-13 14:21:22 +01:00
2026-09-25 16:15:15 +01:00
2026-08-11 15:18:33 +01:00
2026-09-20 13:59:26 +01:00
2026-08-11 16:54:35 +01:00
2026-08-15 16:43:11 +01:00
2026-08-13 13:30:24 +01:00
2026-08-15 20:11:13 +01:00
2026-07-28 09:37:39 +01:00
2026-08-05 01:41:12 +01:00
2026-08-18 16:02:02 +01:00
2026-09-28 09:13:29 +01:00
2026-09-05 01:18:59 +01:00
2026-08-29 16:14:47 +01:00
2026-08-30 15:11:24 +01:00
2026-08-13 14:17:42 +01:00
2026-08-16 18:34:11 +01:00
2026-08-30 15:11:40 +01:00
2026-09-30 20:41:10 +01:00
2026-09-09 17:20:54 +01:00
2026-09-10 22:44:39 +01:00
2026-09-20 13:59:25 +01:00
2026-09-30 20:10:34 +01:00
2026-08-06 17:29:18 +01:00
2026-08-09 23:19:08 +01:00
2026-09-14 18:49:19 +01:00
2026-08-10 18:07:20 +01:00
2026-08-14 14:49:56 +01:00
2026-09-12 21:31:34 +01:00
2026-07-30 17:13:48 +01:00
2026-10-02 17:10:08 +01:00
2026-09-13 17:47:55 +01:00
2026-09-09 11:30:28 +01:00
2026-08-21 16:49:55 +01:00
2026-09-27 18:39:52 +01:00
2026-10-02 16:50:45 +01:00
2026-08-01 12:21:04 +01:00
2026-09-30 20:41:10 +01:00
2026-09-22 17:30:28 +01:00
2026-10-02 17:10:08 +01:00
2026-09-10 22:44:40 +01:00
2026-08-20 15:44:56 +01:00
2026-09-23 17:01:39 +01:00
2026-09-13 17:47:57 +01:00
2026-10-02 16:50:45 +01:00
2026-09-30 20:41:10 +01:00
2026-09-05 01:19:09 +01:00
2026-09-16 14:50:54 +01:00
2026-07-17 10:54:07 +01:00
2026-08-25 18:09:58 +01:00
2026-09-17 11:01:37 +01:00
2026-10-02 17:10:07 +01:00
2026-08-20 16:13:45 +01:00
2026-07-29 17:25:08 +01:00
2026-08-13 14:20:36 +01:00
2026-08-01 11:36:30 +01:00
2026-08-10 18:06:50 +01:00
2026-08-29 16:14:29 +01:00
2026-08-10 18:06:50 +01:00
2026-08-10 18:06:50 +01:00
2026-08-19 14:05:58 +01:00
2026-08-21 19:22:21 +01:00
2026-09-26 13:45:58 +01:00
2026-09-09 17:20:57 +01:00
2026-08-21 16:57:29 +01:00
2026-09-05 21:13:54 +01:00
2026-09-07 19:02:18 +01:00
2026-08-08 23:37:49 +01:00
2026-08-19 14:05:58 +01:00
2026-08-05 22:08:29 +01:00
2026-08-11 14:40:01 +01:00
2026-09-28 10:18:13 +01:00
2026-08-21 16:57:29 +01:00
2026-08-21 16:50:44 +01:00
2026-08-25 15:44:52 +01:00
2026-09-17 11:01:38 +01:00
2026-08-29 16:15:58 +01:00
2026-09-09 17:20:56 +01:00
2026-09-25 15:44:21 +01:00
2026-09-05 21:55:35 +01:00
2026-08-17 15:33:34 +01:00
2026-07-25 22:53:43 +01:00
2026-09-27 18:40:06 +01:00
2026-09-11 22:46:27 +01:00
2026-09-05 21:55:32 +01:00
2026-07-21 21:45:53 +01:00
2026-08-01 11:36:30 +01:00
2026-09-07 18:42:56 +01:00
2026-08-18 22:36:42 +01:00
2026-09-28 09:14:38 +01:00
2026-09-05 21:13:53 +01:00
2026-09-13 17:47:54 +01:00
2026-09-21 18:04:04 +01:00
2026-09-28 10:15:38 +01:00
2026-09-12 17:36:10 +01:00
2026-09-11 22:46:36 +01:00
2026-10-02 17:10:07 +01:00
2026-09-16 14:43:05 +01:00
2026-10-02 17:10:07 +01:00
2026-09-18 15:16:09 +01:00
2026-10-02 17:10:07 +01:00
2026-10-03 20:27:11 +05:30
2026-07-28 09:37:39 +01:00
2026-10-03 19:21:55 +05:30
2026-10-03 20:08:26 +05:30
2026-09-13 17:47:54 +01:00
2026-09-14 18:52:06 +01:00
2026-07-18 19:09:53 +01:00
2026-07-16 23:36:49 +01:00
2026-07-15 15:14:34 +01:00
2026-08-29 18:38:05 +01:00
2026-09-22 17:30:28 +01:00
2026-07-25 22:53:43 +01:00
2026-09-29 14:37:10 +01:00
2026-09-27 18:39:51 +01:00
2026-09-12 21:49:56 +01:00
2026-09-30 20:41:10 +01:00
2026-09-11 22:46:36 +01:00
2026-10-02 17:10:07 +01:00
2026-09-23 17:01:39 +01:00
2026-07-27 10:46:47 +01:00
2026-08-28 01:18:04 +01:00
2026-08-11 14:40:01 +01:00
2026-07-25 15:44:50 +01:00
2026-07-27 10:22:48 +01:00
2026-08-09 23:19:08 +01:00
2026-09-20 13:59:25 +01:00
2026-08-18 16:02:02 +01:00
2026-09-15 18:01:35 +01:00
2026-09-27 18:39:51 +01:00
2026-09-12 17:39:27 +01:00
2026-08-07 22:49:25 +01:00
2026-10-02 17:10:07 +01:00
2026-09-20 18:53:35 +01:00
2026-08-30 15:48:40 +01:00
2026-08-27 20:57:16 +01:00
2026-08-11 15:18:12 +01:00
2026-08-08 23:37:32 +01:00
2026-08-29 16:16:09 +01:00
2026-08-25 15:45:33 +01:00
2026-07-27 10:46:47 +01:00
2026-09-30 20:41:10 +01:00
2026-09-06 16:17:38 +01:00
2026-08-30 15:12:10 +01:00
2026-07-26 11:52:20 +01:00
2026-09-30 20:41:10 +01:00
2026-09-11 22:46:26 +01:00
2026-08-01 11:36:30 +01:00
2026-10-02 17:10:08 +01:00
2026-08-14 14:21:34 +01:00
2026-08-30 15:11:23 +01:00
2026-09-28 10:15:38 +01:00
2026-08-11 14:40:01 +01:00