Bug 5551 – opUnary-opBinary conflict

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2011-02-08T17:04:00Z
Last change time
2011-06-04T21:31:47Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-02-08T17:04:36Z
I think this is correct code (trouble originally found by Charles McAnany): struct Foo { Foo opUnary(string op:"++")() { return this; } Foo opBinary(string op)(int y) { return this; } } void main() { auto f = Foo(); f++; } But DMD 2.051 shows the errors: test.d(11): Error: template test.Foo.opBinary(string op) does not match any function template declaration test.d(11): Error: template test.Foo.opBinary(string op) cannot deduce template function from argument types !()()
Comment #1 by k.hara.pg — 2011-04-29T20:32:11Z
Patch create and send pull request: https://github.com/D-Programming-Language/dmd/pull/50
Comment #2 by bugzilla — 2011-06-04T21:31:47Z