Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for static arrays and non-CTFEable opEquals #50

Merged
merged 1 commit into from
Feb 4, 2024

Conversation

Geod24
Copy link
Member

@Geod24 Geod24 commented Feb 3, 2024

The original intent of this commit was to avoid calling opEquals on types that we were evaluating for optionality, as a simple is comparison is enough. However, is was not used previously because it triggers a deprecation in D: Doing a is b when a and b are static array would compare their .ptr.

Re-writing isOptional and adding test yield some issues with static array support, including compilation error. This is now working and the library will throw a proper error if the length do not match.

@Geod24
Copy link
Member Author

Geod24 commented Feb 3, 2024

Fixes #30

Copy link

codecov bot commented Feb 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f80478a) 84.63% compared to head (c9e734c) 85.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           v1.x.x      #50      +/-   ##
==========================================
+ Coverage   84.63%   85.87%   +1.24%     
==========================================
  Files           5        5              
  Lines         397      432      +35     
==========================================
+ Hits          336      371      +35     
  Misses         61       61              
Flag Coverage Δ
unittests 85.87% <100.00%> (+1.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

The original intent of this commit was to avoid calling `opEquals`
on types that we were evaluating for optionality, as a simple `is`
comparison is enough. However, `is` was not used previously because
it triggers a deprecation in D: Doing `a is b` when `a` and `b`
are static array would compare their `.ptr`.

Re-writing `isOptional` and adding test yield some issues with static
array support, including compilation error. This is now working and
the library will throw a proper error if the length do not match.
@Geod24 Geod24 force-pushed the mlang/StaticArray branch from 9675c00 to c9e734c Compare February 4, 2024 09:41
@Geod24 Geod24 merged commit 2e9eae6 into dlang-community:v1.x.x Feb 4, 2024
15 checks passed
@Geod24 Geod24 deleted the mlang/StaticArray branch February 4, 2024 10:13
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.

1 participant