feat: add error report when default value is invalid - #59
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #59 +/- ##
==========================================
+ Coverage 95.97% 96.68% +0.71%
==========================================
Files 2 2
Lines 149 181 +32
==========================================
+ Hits 143 175 +32
Misses 3 3
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Sep 12, 2026
creasty
pushed a commit
that referenced
this pull request
Sep 12, 2026
#74 and #59 both changed setField's signature, so all five call sites plus the signature conflicted. Resolved by grouping the per-field context rather than threading it: a fieldTag carries the field's name, the tag's value and whether the tag was present, which keeps setField to one context parameter instead of three positional ones, two of them strings. That follows the review note on #74 about hoisting the tag out of shouldInitializeField. The pointer recursion resolved in #59's favour, since propagating that error is what closes #68. There was also a semantic conflict the markers could not show. #74 made `default:""` mean "this type's zero value", and #59 makes an unparsable value an error -- so an empty tag on a numeric field started failing, because "" does not parse. Master's own TestSet_EmptyTag and TestSet_PointerWithEmptyTag caught it. parseErr now returns nil for an empty tag: there is nothing to parse, so there is nothing to report, and the field keeps the zero value it already holds. One place rather than seventeen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JjAoN3BBvc6dfT9pog3kMB
creasty
added a commit
that referenced
this pull request
Sep 12, 2026
Adopt #59: report an error for an invalid default value
This was referenced Sep 12, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improved Error Reporting Mechanism - Pull Request
Overview
This patch includes two major improvements aimed at enhancing the error reporting friendliness.
Commit Contents
Commit 1: Improved Error Reporting for Invalid Default Values (5058a89)
Key Improvements:
setFieldfunctionError Report Example:
will report error
Commit 2: Improved Subfield Error Reporting (df4441b)
Key Improvements:
Test Case Example:
Usage Example
When using invalid default values in configuration structures, clear error information is now provided:
Summary
These improvements make the defaults library provide more friendly and detailed error information when encountering configuration errors.