getAttr method

Frank Benoit keinfarbton at googlemail.com
Fri Feb 1 07:06:28 PST 2008


Ary Borenszweig schrieb:
> Janice Caron escribió:
>> On Feb 1, 2008 9:09 AM, Guillaume Chéreau <charlie137 at gmail.com> wrote:
>>> Hello, I would like to suggest an feature to the language :
>>>
>>> Every time we try to access a member of an object that has no such 
>>> member, the compiler try to call a special method with the member 
>>> name as a template parameter.
>>
>> I'd prefer that if I misspell a member name, the compiler should point
>> out my error, and fail to compile the source, with an indication of
>> the file and line number where the error occurred. (Current behaviour,
>> in other words).
>>
> 
> It will, only if it can't find the getAttr method.

Probably a "static assert" could catch unwanted calls at compile time.



More information about the Digitalmars-d mailing list