D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7340 - inout not resolved for default parameters
Summary: inout not resolved for default parameters
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-21 15:17 UTC by timon.gehr
Modified: 2024-12-13 17:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2012-01-21 15:17:05 UTC
DMD 2.057:
inout(Object) bar(inout(Object) y = null){return y;}
static assert(is(typeof(bar())==typeof(bar(null))));

Error: static assert  (is(inout(Object) == Object)) is false

the code should compile.
Comment 1 Maksim Zholudev 2016-03-28 14:11:41 UTC
DMD 2.070.2
--------------------
inout(int) bar(inout(int) y = 0){return y;}
pragma(msg, typeof(bar()));
pragma(msg, typeof(bar(0)));
--------------------

Output:
--------------------
inout(int)
int
--------------------

`inout` qualifier somehow escapes the context of `bar` function.
Comment 2 dlangBugzillaToGithub 2024-12-13 17:57:56 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18403

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB