digitalmars.D.bugs - [Issue 8461] New: std.container.SList can't work with std.typecons.Proxy
- d-bugmail puremagic.com (50/50) Jul 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8461
- d-bugmail puremagic.com (33/33) Jul 29 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8461
- d-bugmail puremagic.com (11/11) Mar 11 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8461
http://d.puremagic.com/issues/show_bug.cgi?id=8461
Summary: std.container.SList can't work with std.typecons.Proxy
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody puremagic.com
ReportedBy: cpunion gmail.com
code:
---
import std.typecons;
import std.container;
class Foo {
this(int n) {
value = n;
}
mixin Proxy!(value);
private int value;
}
void main() {
SList!Foo list;
list.insertFront(new Foo(1));
}
---
compiler output:
---
$ dmd testslist.d
/home/lijie/.dvm/compilers/dmd-2.059/bin/../src/phobos/std/container.d(938):
Error: template testslist.Foo.Proxy!(value).opCast does not match any function
template declaration
/home/lijie/.dvm/compilers/dmd-2.059/bin/../src/phobos/std/typecons.d(2796):
Error: template testslist.Foo.Proxy!(value).opCast(T,this X) cannot deduce
template function from argument types !(Object)()
/home/lijie/.dvm/compilers/dmd-2.059/bin/../src/phobos/std/container.d(938):
Error: template testslist.Foo.Proxy!(value).opCast does not match any function
template declaration
/home/lijie/.dvm/compilers/dmd-2.059/bin/../src/phobos/std/typecons.d(2796):
Error: template testslist.Foo.Proxy!(value).opCast(T,this X) cannot deduce
template function from argument types !(Object)()
testslist.d(15): Error: template instance std.container.SList!(Foo) error
instantiating
---
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 29 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8461
Shorter code:
---
import std.container;
class Foo {
this(int n) {
value = n;
}
T opCast(T)() {
return cast(T)value;
}
private int value;
}
void main() {
SList!Foo list;
}
---
compile:
---
$ dmd testslist.d
/home/lijie/.dvm/compilers/dmd-2.059/bin/../src/phobos/std/container.d(938):
Error: function testslist.Foo.opCast!(Object).opCast () is not callable using
argument types ()
/home/lijie/.dvm/compilers/dmd-2.059/bin/../src/phobos/std/container.d(938):
Error: function testslist.Foo.opCast!(Object).opCast () is not callable using
argument types ()
testslist.d(16): Error: template instance std.container.SList!(Foo) error
instantiating
---
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 29 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8461
Kenji Hara <k.hara.pg gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WORKSFORME
Works in 2.063alpha.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 11 2013









d-bugmail puremagic.com 