dmd icon indicating copy to clipboard operation
dmd copied to clipboard

fix Issue 20781 - Can call @live function without checking dip1021 rules

Open WalterBright opened this issue 5 years ago • 4 comments

WalterBright avatar Apr 28 '20 10:04 WalterBright

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
20781 normal Can call @live function without checking dip1021 rules

Testing this PR locally

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

dub run digger -- build "master + dmd#11071"

dlang-bot avatar Apr 28 '20 10:04 dlang-bot

The buildkite and DAutoTest look irrelevant.

WalterBright avatar Apr 30 '20 09:04 WalterBright

I haven't been following @live too much, so I was under the impression that it was part of DIP1021, but it's not mentioned anywhere in the DIP, or any other DIPs... So where does it come from ?

Geod24 avatar Apr 30 '20 12:04 Geod24

So my question wasn't answered. What's the point of -preview=dip1021 when it the checks are actually performed when @live is used ?

Geod24 avatar Jun 11 '20 09:06 Geod24

@Geod24 :

As the comment in the code says, "Test compliance with DIP1021 Argument Ownership and Function Calls", and the code is under the check for DIP1021

WalterBright avatar Feb 07 '23 05:02 WalterBright

Dip1021 was a step towards @live by not allowing multiple mutable pointers to be passed to a function.

WalterBright avatar Feb 07 '23 05:02 WalterBright

This makes no sense at all:

Test 'runnable/test20855.d' failed. The logged output:
/private/var/folders/hy/gdmd645x1ws410vx266t7py00000gn/T/cirrus-ci-build/generated/osx/release/64/dmd -conf= -m64 -Irunnable  -fPIC  -odtest_results/runnable -oftest_results/runnable/test20855_0  runnable/test20855.d 
test_results/runnable/test20855_0  --DRT-testmode=run-main
core.exception.AssertError@runnable/test20855.d(25): Assertion failure
----------------
??:? _d_assertp [0x10060340c]
??:? _Dmain [0x1005f56d1]
a = 491

why does it work on every other platform?

WalterBright avatar Feb 07 '23 07:02 WalterBright

Weird how that assert failure disappeared after a rebase. It implies the state of the repository is not always in a working state.

WalterBright avatar Feb 07 '23 08:02 WalterBright