opDispatch with template parameter and property syntax doesn't work

Eldar Insafutdinov e.insafutdinov at gmail.com
Tue Jan 12 12:44:57 PST 2010


Jacob Carlborg Wrote:

> The following doesn't work, is it a known issue or should I report it.
> 
> class C
> {
> 	void opDispatch (string str, T) (T t) {}
> }
> 
> class D
> {
> 	void opDispatch (string str) (int t) {}
> }
> 
> C c = new C;
> c.foo = 3; // doesn't work
> c.foo(3); // works
> 
> D d = new D;
> d.foo = 3; // works

If you watched the presentation by Anders Hejlsberg which was posted here recently, they have different methods to implement for methods and property look up for their dynamic type system. I would not want to have them mixed. Maybe something like opProperty?



More information about the Digitalmars-d mailing list