Skip to content

eval: report validation error locations#3895

Merged
raphael merged 1 commit into
v3from
fix/relocated-types-validation-locations
Feb 16, 2026
Merged

eval: report validation error locations#3895
raphael merged 1 commit into
v3from
fix/relocated-types-validation-locations

Conversation

@raphael
Copy link
Copy Markdown
Member

@raphael raphael commented Feb 16, 2026

Summary

  • Add file:line prefixes to validation errors when the failing expression has a DSL function pointer, making it straightforward to locate the offending design declaration.
  • Refactor computeErrorLocation to use runtime.CallersFrames instead of repeated runtime.Caller calls, which is robust to inlining and avoids hardcoding call-depth assumptions.
  • Add isGoaSourceFile to reliably skip internal Goa frames even when inlining collapses the stack.
  • Add validationErrorLocation / dslFuncLocation to derive locations from the expression's DSL function pointer for Validate()-phase errors.
  • Add tests covering DSL errors, validation errors with and without locations, and cross-package RunDSL error propagation.

Test plan

  • make test — all passing
  • make lint — 0 issues
  • New tests in eval/error_location_test.go and eval/run_dsl_error_location_test.go
  • Existing expr/ validation tests updated for new location prefixes

Add file:line prefixes to validation errors when the failing expression has a DSL function pointer.
Refactor DSL error location resolution to skip internal Goa frames reliably and add tests that assert locations for both DSL and validation errors.
@raphael raphael merged commit 3d421fe into v3 Feb 16, 2026
13 checks passed
@raphael raphael deleted the fix/relocated-types-validation-locations branch February 16, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant