Skip to content

Convert custom sources to dictionaries through lower - #106

Merged
quinnj merged 2 commits into
mainfrom
maintenance/custom-struct-dictionaries
Oct 14, 2026
Merged

quinnj merged 2 commits into
mainfrom
maintenance/custom-struct-dictionaries

Conversation

@quinnj

@quinnj quinnj commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Converting a valid CustomStruct source with StructTypes.constructfrom(Dict{String, Any}, value) raises MethodError because dictionary conversion has no dispatcher for that source trait. Call the required lower(value) method, then resume the existing dictionary conversion. This preserves target key/value conversion and supports a custom lowering that exposes type-parameter metadata. Fixes #69.

Add 22 checks covering the reported parametric case, dictionary and named-tuple lowerings, typed keys/values, nested wrappers, empty sources, delegated errors, and unchanged Any identity. Full four-thread/bounds suites and a separate 12-check public probe pass on Julia 1.6.7 and 1.13.1; unchanged main has one control pass and 11 MethodErrors in that probe. The strict Documenter 1.19 build passes on Julia 1.13.1. All seven exact-head GitHub checks pass at d8c883407a0bb797b31f682d2d4a76873b1b33eb; all four coverage uploads were accepted for JuliaData/StructTypes.jl at that revision and processed (77.63%).

This is based on #105, which restores the shared Julia UUID test expectation and CI/docs checks. It remains dependent on that PR and the normal independent-review gate for main.

Co-authored by Codex

AI disclosure: This work was prepared with assistance from OpenAI Codex.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.38%. Comparing base (dbe4efb) to head (497e27c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
+ Coverage   76.57%   78.38%   +1.81%     
==========================================
  Files           2        2              
  Lines         414      421       +7     
==========================================
+ Hits          317      330      +13     
+ Misses         97       91       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@quinnj
quinnj force-pushed the maintenance/custom-struct-dictionaries branch from d8c8834 to 2b89ea5 Compare October 14, 2026 00:28
@quinnj

quinnj commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Pushed 2b89ea5: the same missing CustomStruct source dispatch also failed for Struct and Mutable targets (constructfrom(MyStruct, custom) hit a MethodError), so those now go through lower too. Tests trimmed to cover the issue case plus each target kind.

Base automatically changed from maintenance/struct-field-defaults to main October 14, 2026 00:56
quinnj and others added 2 commits October 13, 2026 18:56
Dictionary conversion has no source dispatcher for CustomStruct, so even a
valid lower implementation raises MethodError. Lower the object and resume
the existing dictionary conversion, preserving target key/value types and
ordinary source handling. Document the source contract and add 22 checks.

Full four-thread/bounds suites and a 12-check public reproduction pass on
Julia 1.6.7 and 1.13.1. The strict Documenter 1.19 build also passes.

AI disclosure: This work was prepared with assistance from OpenAI Codex.
…ests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@quinnj
quinnj force-pushed the maintenance/custom-struct-dictionaries branch from 2b89ea5 to 497e27c Compare October 14, 2026 00:56
@quinnj
quinnj merged commit 9406291 into main Oct 14, 2026
7 checks passed
@quinnj
quinnj deleted the maintenance/custom-struct-dictionaries branch October 14, 2026 01:04
@quinnj quinnj mentioned this pull request Oct 15, 2026
quinnj referenced this pull request Oct 15, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

missing constructfrom method for CustomStruct?

1 participant