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

Add safeOnly UDA, associated tests. Fix issue with opUnary. #40

Merged
merged 1 commit into from
Dec 1, 2019

Conversation

schveiguy
Copy link
Contributor

Kind of helps with #39 as my real goal is to have a safe-only algebraic type. But the main crux of that issue is still present (no way to disable other ops), which might have other use cases.

But this is hugely important for my work. I want a fully-safe algebraic type to use in mysql-native.

I also found a bug in opUnary (apparently nobody ever used it!).

}

// only safe operations allowed on pointer field
@safe test() {
Copy link
Owner

Choose a reason for hiding this comment

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

Is this intentionally not executed? It looks like the code could just directly be in the unit test itself, which would then hopefully fix the overall coverage loss.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, not intentionally. It was meant to show in docs that the code can be done in safe mode (not sure if safe unittests show as such). I didn’t even consider that it is why code coverage is failing. Will fix.

@schveiguy
Copy link
Contributor Author

I included the test call. I'm looking at the coverage report, and I'm not sure what I'm doing wrong to have 2 of them fail. Looking at the coverage report, it's highlighting blank lines as not being covered?

@s-ludwig
Copy link
Owner

s-ludwig commented Dec 1, 2019

Okay, looks good now (bummer though that the coverage info is not smarter w.r.t. declarations and CTFE)!

@s-ludwig s-ludwig merged commit fe2447f into s-ludwig:master Dec 1, 2019
@schveiguy schveiguy deleted the addsafeonly branch December 1, 2019 23:44
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