Skip to content

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Jan 4, 2019

Copy over the existing tests he said.

And again he said please copy over the existing tests.

And he said again there are still no tests.

CC @andralex @thewilsonator PLEASE PLEASE STOP MERGING STUFF WITHOUT TESTS.

With the fixes, the first test file yields a segfault of DMD, because this assertion no longer holds:

assert(s.label.statement);

but I'm not in the mood to look into this.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
19549 critical -check=in=off doesn't work

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "stable + dmd#9195"

@thewilsonator
Copy link
Contributor

Yeah the original code look very broken because if (!global.params.useIn) is true any any explicit value of the switch, i.e. in=off has the same effect as in=on! This patch doesn't take into account @safe functions however

if (global.params.useOut == CHECKENABLE.off)

needs to be something like

if (global.params.useOut == CHECKENABLE.off ||
   (global.params.useOut == CHECKENABLE.safeOnly && f.trust != TRUST.safe))

Copy link
Member

@WalterBright WalterBright left a comment

Choose a reason for hiding this comment

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

Once it passes the test suite.

@wilzbach wilzbach force-pushed the tests-dip1006 branch 2 times, most recently from 7719fa4 to 11cc425 Compare January 6, 2019 13:25
@wilzbach
Copy link
Contributor Author

wilzbach commented Jan 6, 2019

but I'm not in the mood to look into this.

Okay, I found the missing bit, but PLEASE PLEASE PLEASE let's NOT merge new features without tests again.

Yeah the original code look very broken

Yup any kind of test would have spotted that (or you know also no implicit bool conversion from an enum in a condition).

This patch doesn't take into account @safe functions however

CHECKENABLE.safeOnly is only used for useArrayBounds (a bit confusing to the same type for both though).

@thewilsonator
Copy link
Contributor

Okay, I found the missing bit, but PLEASE PLEASE PLEASE let's NOT merge new features without tests again.

Duly noted.

@wilzbach wilzbach merged commit de293a1 into dlang:stable Jan 7, 2019
@wilzbach wilzbach deleted the tests-dip1006 branch January 7, 2019 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants