[Issue 10150] Prefix method 'this' qualifiers should be just ignored anytime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 30 11:51:09 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10150



--- Comment #11 from monarchdodra at gmail.com 2013-06-30 11:51:09 PDT ---
(In reply to comment #10)
> I want both to go to return type. Prefix qualifier -> return type. Postfix
> qualifier -> function type.

Typ? "Both", then you state two different things.

> If qualifier is not applicable to return type, it
> falls through to function type (as far as I understand the grammar anyway).

AFAIK, anything returnable can be qualified with const, so there would be no
fall through case.

> Simple and obvious.
> 
> The very idea that prefix qualifier has something to do with function type is
> confusing and error-prone. And this change makes it much worse.

What about:

--------
struct S
{
    const nothrow pure
    T foo();

    nothrow pure const
    T bar();
}
--------

What does (should) foo return? What about bar?

The current rules are obvious: stand alone attribute => Function.
Simple and obvious.
There is no reasons for "const" to get special treatment.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list