April 11, 2014 [Issue 12559] New: Multi operators with template mixins produces an error | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=12559 Issue ID: 12559 Summary: Multi operators with template mixins produces an error Product: D Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: DMD Assignee: nobody@puremagic.com Reporter: temtaime@gmail.com mixin template T() { S opBinary(string s)(S s) { return S(); } } struct S { S opBinary(string s)(S s) if(0) { return S(); } mixin T; } void main() { S a, b; a + b; } Error: incompatible types for ((a) + (b)): 'S' and 'S' But struct S { S opBinary(string s)(S s) if(0) { return S(); } S opBinary(string s)(S s) { return S(); } } void main() { S a, b; a + b; } Compiles ok -- |
Copyright © 1999-2021 by the D Language Foundation