D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20540 - (White|Black)Hole does not work with return|scope functions
Summary: (White|Black)Hole does not work with return|scope 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: 2020-01-27 19:13 UTC by moonlightsentinel
Modified: 2020-01-28 00:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2020-01-27 19:13:26 UTC
White/BlackHole does not generate correct function signatures for functions annotated with return/scope:

------------------------------------

import std.typecons;

interface I
{
    I foo() return scope;
}

void main()
{
    scope i = new BlackHole!I();
    i.foo();
}

------------------------------------

/dlang/dmd/linux/bin64/../../src/phobos/std/typecons.d-mixin-4543(4544): Error: function I std.typecons.AutoImplement!(I, generateEmptyFunction, isAbstractFunction).AutoImplement.foo() does not override any function, did you mean to override scope I onlineapp.I.foo() return?
/dlang/dmd/linux/bin64/../../src/phobos/std/typecons.d(4315): Error: template instance std.typecons.AutoImplement!(I, generateEmptyFunction, isAbstractFunction) error instantiating
onlineapp.d(10):        instantiated from here: BlackHole!(I)
Comment 1 Dlang Bot 2020-01-27 19:18:22 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 20540 - (White|Black)Hole does not work with return|scope functions

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

- af50bed328bd0999d2cd10a49ce1c69d0ee6e233 by MoonlightSentinel:
  Fix Issue 20540 - (White|Black)Hole does not work with return|scope functions

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