Bug 20129 – AA require with File values gives "Error: `return` expression expected" in object.d

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-13T20:26:17Z
Last change time
2019-08-14T01:00:51Z
Keywords
pull
Assigned to
No Owner
Creator
Vladimir Panteleev

Comments

Comment #0 by dlang-bugzilla — 2019-08-13T20:26:17Z
/////////////// test.d ////////////// import std.stdio; void main() { File[int] aa; aa.require(0, File("/dev/null")); } ///////////////////////////////////// /path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/object.d(3544): Error: `return` expression expected test.d(6): Error: template instance `object.require!(int, File)` error instantiating The cause is that File.opAssign returns void instead of File.
Comment #1 by dlang-bot — 2019-08-13T20:32:12Z
@CyberShadow created dlang/phobos pull request #7131 "Fix Issue 20129 - AA require with File values gives "Error: `return` …" fixing this issue: - Fix Issue 20129 - AA require with File values gives "Error: `return` expression expected" in object.d https://github.com/dlang/phobos/pull/7131
Comment #2 by dlang-bot — 2019-08-14T01:00:51Z
dlang/phobos pull request #7131 "Fix Issue 20129 - AA require with File values gives "Error: `return` …" was merged into master: - a15af9cf5556ebfa96396deaf177d41f9fe1e4a0 by Vladimir Panteleev: Fix Issue 20129 - AA require with File values gives "Error: `return` expression expected" in object.d https://github.com/dlang/phobos/pull/7131