Skip to content

Add unary operator forwarding support#44

Merged
MooVC merged 4 commits intomasterfrom
codex/extend-monify-to-support-unary-operators
Nov 28, 2025
Merged

Add unary operator forwarding support#44
MooVC merged 4 commits intomasterfrom
codex/extend-monify-to-support-unary-operators

Conversation

@MooVC
Copy link
Owner

@MooVC MooVC commented Nov 28, 2025

Summary

  • detect unary operators exposed by encapsulated types and include them in subject metadata
  • generate forwarding unary operators on Monify types and integrate the new strategy with the generator
  • add coverage for unary operator discovery and generation logic

Testing

  • dotnet test (fails: SDK 9.0.112 does not support targeting net10.0)

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +51 to +53
string result = unary.IsReturnSubject
? $"return new {subject.Qualification}({operation});"
: $"return ({returnType}){operation};";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid casting subject to bool in true/false forwarding

When forwarding operator true/false, the generated method builds return (bool)subject._value ? … : …; (UnaryOperatorStrategy.cs lines 51-53). Types that expose only operator true/false—like the new Value example—are not implicitly convertible to bool, so this cast fails to compile and the emitted operator bodies are invalid whenever the encapsulated type lacks an explicit bool conversion.

Useful? React with 👍 / 👎.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 87.05036% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.57%. Comparing base (11b3998) to head (dd1d3e1).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...cs/INamedTypeSymbolExtensions.GetUnaryOperators.cs 76.92% 6 Missing and 3 partials ⚠️
src/Monify/Strategies/UnaryOperatorStrategy.cs 90.00% 6 Missing and 2 partials ⚠️
...ics/INamedTypeSymbolExtensions.HasUnaryOperator.cs 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
- Coverage   90.77%   90.57%   -0.20%     
==========================================
  Files          52       56       +4     
  Lines        1106     1242     +136     
  Branches      131      148      +17     
==========================================
+ Hits         1004     1125     +121     
- Misses         51       63      +12     
- Partials       51       54       +3     

☔ View full report in Codecov by Sentry.
📢 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.

@MooVC MooVC merged commit 20d9dd5 into master Nov 28, 2025
1 of 3 checks passed
@MooVC MooVC deleted the codex/extend-monify-to-support-unary-operators branch November 28, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant