August 13, 2019 [Issue 20129] New: AA require with File values gives "Error: `return` expression expected" in object.d | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20129 Issue ID: 20129 Summary: AA require with File values gives "Error: `return` expression expected" in object.d Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: dlang-bugzilla@thecybershadow.net /////////////// 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. -- |
Copyright © 1999-2021 by the D Language Foundation