Skip to content

test: value class mapping with companion operator invoke#9

Merged
wilmveel merged 1 commit intomainfrom
feature/value-class-companion-invoke-tests
Mar 19, 2026
Merged

test: value class mapping with companion operator invoke#9
wilmveel merged 1 commit intomainfrom
feature/value-class-companion-invoke-tests

Conversation

@wilmveel
Copy link
Copy Markdown
Contributor

Summary

  • Adds two integration tests verifying value class wrap/unwrap works when the value class defines operator fun invoke on a companion object (common pattern for validation)
  • Tests confirm the mapper correctly uses the primary constructor, bypassing companion invoke validation

Test plan

  • shouldCompile_valueClassWrapWithCompanionInvoke — wraps StringEmail value class with companion invoke validation
  • shouldCompile_valueClassUnwrapWithCompanionInvoke — unwraps EmailString with same companion invoke

🤖 Generated with Claude Code

Verifies that mapping works correctly for value classes that define
operator fun invoke on their companion object for validation purposes.
The mapper uses the primary constructor directly, bypassing companion invoke.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wilmveel wilmveel merged commit 572f8d4 into main Mar 19, 2026
1 check passed
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.

2 participants