digitalmars.D.learn - opDispatch bug?
- Zhenya (17/17) Dec 15 2012 Hi!
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (7/23) Dec 15 2012 this.bar = i;
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/5) Dec 15 2012 Wow. I made a typo in typo. :) That should be:
- Zhenya (2/7) Dec 15 2012 It's pretty reasonable,thank you.
Hi! Is it a bug? class Foo { int m_bar; char m_gun; property auto ref opDispatch(string s)() { return mixin("m_"~s); } this(int i,char c) { bar = i;//Error: undefined identifier bar, did you mean variable m_bar? this.gun = c; } }
Dec 15 2012
On 12/15/2012 10:01 AM, Zhenya wrote:Hi! Is it a bug? class Foo { int m_bar; char m_gun; property auto ref opDispatch(string s)() { return mixin("m_"~s); } this(int i,char c) { bar = i;//Error: undefined identifier bar, did you mean variable m_bar?this.bar = i; Because when it is simply bar, there is no indication that we are talking about a member of this type. So, opDispatch() is not considered. It could be the other way around as well, but personally I like the current behaviour. Otherwise any type would go to opDispatch.this.gun = c; } }Ali
Dec 15 2012
On 12/15/2012 10:07 AM, Ali Çehreli wrote:Otherwise any type would go to opDispatch.Wow. I made a typo in typo. :) That should be: Otherwise any _typo_ would go to opDispatch. Ali
Dec 15 2012
On Saturday, 15 December 2012 at 18:09:00 UTC, Ali Çehreli wrote:On 12/15/2012 10:07 AM, Ali Çehreli wrote:It's pretty reasonable,thank you.Otherwise any type would go to opDispatch.Wow. I made a typo in typo. :) That should be: Otherwise any _typo_ would go to opDispatch. Ali
Dec 15 2012