Skip to content

fix: don't require constructor on source type in mapper#17

Merged
wilmveel merged 1 commit intomainfrom
fix/source-type-no-constructor-crash
Mar 25, 2026
Merged

fix: don't require constructor on source type in mapper#17
wilmveel merged 1 commit intomainfrom
fix/source-type-no-constructor-crash

Conversation

@wilmveel
Copy link
Copy Markdown
Contributor

Summary

  • Make Shape.constructor nullable so source types without constructors (interfaces, abstract classes, private constructors from other modules) don't crash the compiler plugin
  • When no constructor is available, fall back to readable properties for field resolution
  • Only error on missing constructor for target types (where construction is actually needed)

Closes #16

Test plan

🤖 Generated with Claude Code

The compiler plugin crashed with 'No primary constructor found' when the
source type had no accessible constructor (e.g. private constructor,
interface). The source type only needs readable properties, not a
constructor — only the target type needs one for construction.

Closes #16

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wilmveel wilmveel merged commit 2a2c5a2 into main Mar 25, 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.

Compiler crash: private constructor on source type causes 'No primary constructor found'

1 participant