| Thread overview | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 22, 2013 What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
struct Test
{
int i;
alias this = i;
}
Worked fine in 2.061 but in 2.062 I get the errors
"Error: no identifier for declarator this" and "Error: alias cannot have initializer".
Was something changed intentionally or is this a bug?
| ||||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Martin | Martin:
> Was something changed intentionally or is this a bug?
It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases.
Bye,
bearophile
| |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote:
> Martin:
>
>> Was something changed intentionally or is this a bug?
>
> It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases.
>
> Bye,
> bearophile
I see, thanks. What was the reason for not allowing alias this = identifier?
| |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Martin | On Friday, 22 February 2013 at 14:58:02 UTC, Martin wrote:
> On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote:
>> Martin:
>>
>>> Was something changed intentionally or is this a bug?
>>
>> It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases.
>>
>> Bye,
>> bearophile
>
> I see, thanks. What was the reason for not allowing alias this = identifier?
Requiring lookahead when parsing.
| |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On Friday, 22 February 2013 at 15:07:29 UTC, deadalnix wrote:
> On Friday, 22 February 2013 at 14:58:02 UTC, Martin wrote:
>> On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote:
>>> Martin:
>>>
>>>> Was something changed intentionally or is this a bug?
>>>
>>> It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases.
>>>
>>> Bye,
>>> bearophile
>>
>> I see, thanks. What was the reason for not allowing alias this = identifier?
>
> Requiring lookahead when parsing.
Alright, thanks!
| |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Martin | On Friday, 22 February 2013 at 15:31:43 UTC, Martin wrote:
> On Friday, 22 February 2013 at 15:07:29 UTC, deadalnix wrote:
>> On Friday, 22 February 2013 at 14:58:02 UTC, Martin wrote:
>>> On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote:
>>>> Martin:
>>>>
>>>>> Was something changed intentionally or is this a bug?
>>>>
>>>> It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases.
>>>>
>>>> Bye,
>>>> bearophile
>>>
>>> I see, thanks. What was the reason for not allowing alias this = identifier?
>>
>> Requiring lookahead when parsing.
>
> Alright, thanks!
Just to be clear : that was sarcastic, requiring lookahead when parsing is a drawback.
The idea is that alias and alias this are 2 different beasts. For instance you can have multiple alias this when you can only have one name per identifier.
It was wanted to distinguish the 2 with 2 different syntaxes.
| |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | On 02/22/2013 06:55 AM, bearophile wrote: > Martin: > >> Was something changed intentionally or is this a bug? > > It was changed intentionally, but only for alias this. That syntax is > allowed still for other aliases. It is a regression at best because it is nowhere to be found in the changelog, at least not without clicking every single item in those lists. Ali | |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On 02/22/2013 09:08 AM, Ali Çehreli wrote: > On 02/22/2013 06:55 AM, bearophile wrote: > > Martin: > > > >> Was something changed intentionally or is this a bug? > > > > It was changed intentionally, but only for alias this. That syntax is > > allowed still for other aliases. > > It is a regression at best Posted: http://d.puremagic.com/issues/show_bug.cgi?id=9569 Ali | |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli Attachments:
| 2013/2/23 Ali Çehreli <acehreli@yahoo.com> > On 02/22/2013 06:55 AM, bearophile wrote: > > Martin: > > > >> Was something changed intentionally or is this a bug? > > > > It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases. > > It is a regression at best because it is nowhere to be found in the changelog, at least not without clicking every single item in those lists. That is intended change. https://github.com/D-Programming-Language/dmd/issues/1413 https://github.com/D-Programming-Language/d-programming-language.org/pull/224 Kenji Hara | |||
February 22, 2013 Re: What happened to the alias this = identifier syntax in 2.062? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to kenji hara | On 02/22/2013 09:28 AM, kenji hara wrote: > 2013/2/23 Ali Çehreli<acehreli@yahoo.com> > >> On 02/22/2013 06:55 AM, bearophile wrote: >>> Martin: >>> >>>> Was something changed intentionally or is this a bug? >>> >>> It was changed intentionally, but only for alias this. That syntax is >>> allowed still for other aliases. >> >> It is a regression at best because it is nowhere to be found in the >> changelog, at least not without clicking every single item in those lists. > > > That is intended change. > https://github.com/D-Programming-Language/dmd/issues/1413 > https://github.com/D-Programming-Language/d-programming-language.org/pull/224 I appreciate everybody's contributions to D but that is not an intention, that is a change to dmd that caused a regression. A syntax that used to work in the previous version simply stopped working in 2.062. That is the definition of a regression. Normally, regressions are fixed as quickly as possible. I have a feeling that there must have been some newsgroup discussions as well but unfortunately I must have been busy with other things at the time. Not all of us read github. Ali | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply