Bug 105 – abiguity for opCall

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-04-13T18:36:00Z
Last change time
2014-02-15T02:08:32Z
Assigned to
bugzilla
Creator
benoit

Comments

Comment #0 by benoit — 2006-04-13T18:36:34Z
While a function works fine, opCall does not: import std.stdio; template T( int i ){ public void foo(){ writefln( "%d", i ); } public void opCall(){ // line 9 writefln( "%d", i ); } } class C{ } class C1 : C { mixin T!( 1 ) t1; mixin T!( 2 ) t2; } void main(){ C1 c1 = new C1; c1.t1.foo(); c1.t1(); // this causes the error } snippets/opCall.d(9): function snippets.opCall.C1.mixin T!(1); .opCall conflicts with snippets.opCall.C1.mixin T!(2); .opCall at snippets/opCall.d(9)
Comment #1 by thomas-dloop — 2006-04-18T01:35:26Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-04-13: > While a function works fine, opCall does not: > > import std.stdio; > > template T( int i ){ > public void foo(){ > writefln( "%d", i ); > } > public void opCall(){ // line 9 > writefln( "%d", i ); > } > } > > class C{ > } > > class C1 : C { > mixin T!( 1 ) t1; > mixin T!( 2 ) t2; > } > > void main(){ > C1 c1 = new C1; > c1.t1.foo(); > c1.t1(); // this causes the error > } Added to DStress as http://dstress.kuehne.cn/run/m/mixin_20_A.d http://dstress.kuehne.cn/run/m/mixin_20_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFERI4p3w+/yD4P9tIRAp+RAKDENdrJNKU7v0r6FFNL62zZCIbh0wCeIpEi z+cw8ZQk2F0Tp0Ujhq83OYY= =4q/n -----END PGP SIGNATURE-----
Comment #2 by bugzilla — 2006-04-28T02:56:33Z
Fixed 0.155