D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20232 - WhiteHole is unusable with @safe interface functions
Summary: WhiteHole is unusable with @safe interface functions
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-09-20 01:19 UTC by Andrej Mitrovic
Modified: 2020-01-28 00:05 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2019-09-20 01:19:56 UTC
```
import std.typecons;

interface I
{
    @safe:
    void foo ();
}

void main ()
{
    auto c = new WhiteHole!I;  // error
    auto c = new BlackHole!I;  // ok
}
```

/Library/D/dmd/src/phobos/std/typecons.d-mixin-4530(4535): Error: `@safe` function `std.typecons.AutoImplement!(I, generateAssertTrap, isAbstractFunction).AutoImplement.foo` cannot call `@system` constructor `std.typecons.NotImplementedError.this`
Comment 1 Dlang Bot 2020-01-27 18:00:58 UTC
@MoonlightSentinel created dlang/phobos pull request #7375 "Fix Issue 20232 - WhiteHole is unusable with @safe interface functions" fixing this issue:

- Fix Issue 20232 - WhiteHole is unusable with @safe interface functions

https://github.com/dlang/phobos/pull/7375
Comment 2 Dlang Bot 2020-01-27 19:18:21 UTC
@MoonlightSentinel created dlang/phobos pull request #7376 "Fix Issue 20540 - (White|Black)Hole does not work with return|scope functions" fixing this issue:

- Fix Issue 20232 - WhiteHole is unusable with @safe interface functions

https://github.com/dlang/phobos/pull/7376
Comment 3 Dlang Bot 2020-01-28 00:05:27 UTC
dlang/phobos pull request #7376 "Fix Issue 20540 - (White|Black)Hole does not work with return|scope functions" was merged into master:

- 869d9b561332ac0bf15a1c5db188d99aa8636ddb by MoonlightSentinel:
  Fix Issue 20232 - WhiteHole is unusable with @safe interface functions

https://github.com/dlang/phobos/pull/7376