October 10, 2011 [Issue 3474] PATCH: Implement opDollar for struct and class indexing operations | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don | http://d.puremagic.com/issues/show_bug.cgi?id=3474 --- Comment #10 from Kenji Hara <k.hara.pg@gmail.com> 2011-10-10 02:33:26 PDT --- Posted pull request. https://github.com/D-Programming-Language/dmd/pull/442 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 22, 2011 [Issue 3474] PATCH: Implement opDollar for struct and class indexing operations | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don | http://d.puremagic.com/issues/show_bug.cgi?id=3474 --- Comment #11 from bearophile_hugs@eml.cc 2011-11-22 00:05:51 PST --- With the recent patch this doesn't compile, is this expected? struct Foo { int x; alias x opDollar; int opIndex(int k) { return x * k; } } void main() { Foo f = Foo(7); int x = f[$ - 5]; // Error: undefined identifier __dollar assert(x == 2 * 7); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 22, 2011 [Issue 3474] PATCH: Implement opDollar for struct and class indexing operations | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don | http://d.puremagic.com/issues/show_bug.cgi?id=3474 --- Comment #12 from Don <clugdbug@yahoo.com.au> 2011-11-22 00:30:59 PST --- (In reply to comment #11) > With the recent patch this doesn't compile, is this expected? > > > struct Foo { > int x; > alias x opDollar; > int opIndex(int k) { return x * k; } > } > void main() { > Foo f = Foo(7); > int x = f[$ - 5]; // Error: undefined identifier __dollar > assert(x == 2 * 7); > } Yes, it checks that opDollar is either a function or a template function. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 22, 2011 [Issue 3474] PATCH: Implement opDollar for struct and class indexing operations | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don | http://d.puremagic.com/issues/show_bug.cgi?id=3474 --- Comment #13 from Don <clugdbug@yahoo.com.au> 2011-11-22 00:43:02 PST --- Poor error message though. All the overloaded operators have bad errors: struct S { void x() {} alias x opUnary; } void main() { S a; a = -a; } test.d(9): Error: a.x isn't a template struct S { int x; alias x opUnary; } void main() { S a; a = -a; } test.d(9): Error: 'a' is not of arithmetic type, it is a S -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 22, 2011 [Issue 3474] PATCH: Implement opDollar for struct and class indexing operations | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don | http://d.puremagic.com/issues/show_bug.cgi?id=3474 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #14 from Walter Bright <bugzilla@digitalmars.com> 2011-11-22 02:56:58 PST --- https://github.com/D-Programming-Language/dmd/commit/aba0f773416e1d45d227159cb22ad0e26bb980c0 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation