Bug 15361 – Incomprehensible error message: function declaration without return type.
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2015-11-19T07:28:04Z
Last change time
2019-04-09T11:45:30Z
Keywords
pull
Assigned to
No Owner
Creator
deadalnix
Comments
Comment #0 by deadalnix — 2015-11-19T07:28:04Z
So I did
enum isErrorizable(T) = is(errorize(T.init));
Which, quite obvious, give me the error :
function declaration without return type. (Note that constructors are always named 'this')
I intended to do
enum isErrorizable(T) = is(typeof(errorize(T.init)));
but that wasn't really obvious from the error message. Even by writting a D compiler myself, I have no idea how the compiler come to such conclusion that I'm trying to declare a function.
Comment #1 by razvan.nitu1305 — 2018-06-08T12:48:13Z
Comment #2 by razvan.nitu1305 — 2018-06-08T15:51:31Z
Closing as wontfix. See the above PR for more information
Comment #3 by dlang-bot — 2019-04-05T10:08:41Z
@RazvanN7 updated dlang/dmd pull request #8344 "Fix Issue 15361 - Incomprehensible error message: function declaration without return type" fixing this issue:
- Fix Issue 15361 - Incomprehensible error message: function declaration without return type
https://github.com/dlang/dmd/pull/8344
Comment #4 by dlang-bot — 2019-04-09T11:45:30Z
dlang/dmd pull request #8344 "Fix Issue 15361 - Incomprehensible error message: function declaration without return type" was merged into master:
- 12bf39cb57153c1ca7739023a35b3abf3d74d8da by RazvanN7:
Fix Issue 15361 - Incomprehensible error message: function declaration without return type
https://github.com/dlang/dmd/pull/8344