D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20439 - memoize fails with types that have a void opAssign
Summary: memoize fails with types that have a void opAssign
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-12-09 09:18 UTC by Ali Ak
Modified: 2019-12-13 04:02 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 Ali Ak 2019-12-09 09:18:57 UTC
struct S(T) {
    void opAssign(T)(T) {}
}

S!int f() {
    return S!int();
}

void main()
{
    alias test = memoize!f;
}

functional.d(1138): Error: return expression expected
Comment 1 Dlang Bot 2019-12-09 09:43:11 UTC
@aliak00 updated dlang/phobos pull request #7311 "Fixes 20439: fix memoize return statement" fixing this issue:

- Fixes issue 20439: fix memoize return statement

https://github.com/dlang/phobos/pull/7311
Comment 2 Dlang Bot 2019-12-13 04:02:32 UTC
dlang/phobos pull request #7311 "Fixes 20439: fix memoize return statement" was merged into master:

- 398d63169eb250bc125c62a59e1cc5922e31df29 by Ali Akhtarzada:
  Fixes issue 20439: fix memoize return statement

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