Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent behavior of type qualifier inout + const #18740

Open
dlangBugzillaToGithub opened this issue Dec 18, 2013 · 2 comments
Open

inconsistent behavior of type qualifier inout + const #18740

dlangBugzillaToGithub opened this issue Dec 18, 2013 · 2 comments

Comments

@dlangBugzillaToGithub
Copy link

Kenji Hara (@9rnsr) reported this on 2013-12-18T20:00:45Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=11768

Description

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
}
@dlangBugzillaToGithub
Copy link
Author

k.hara.pg commented on 2013-12-18T20:16:17Z

https://github.com/D-Programming-Language/dmd/pull/2987

@dlangBugzillaToGithub
Copy link
Author

github-bugzilla commented on 2013-12-21T12:56:11Z

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`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant