D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11768 - inconsistent behavior of type qualifier inout + const
Summary: inconsistent behavior of type qualifier inout + const
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: pull, wrong-code
Depends on:
Blocks:
 
Reported: 2013-12-18 20:00 UTC by Kenji Hara
Modified: 2024-12-13 18:15 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 Kenji Hara 2013-12-18 20:00:45 UTC
Currently inout(const(T)) should become const(T).

Test case:

void test1(inout int = 0)
{
    const(inout(char)) k1;
    inout(const(char)) k2;
    static assert(typeof(k1).stringof == "const(char)");    // OK
    static assert(typeof(k2).stringof == "const(char)");    // fails
    static assert(is(typeof(k1) == typeof(k2)));            // fails
}
Comment 2 github-bugzilla 2013-12-21 12:56:11 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/09448ff6c3d1a273444983cf94f9b07ff70d112d
fix Issue 11768 - inconsistent behavior of type qualifier inout + const

Fix up `Parser::parseBasicType` by using `Type::addSTC`
Comment 3 dlangBugzillaToGithub 2024-12-13 18:15:17 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

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

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