Bug 5424 – Cant assign interfaces to Variants

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2011-01-07T19:45:00Z
Last change time
2011-01-23T20:29:37Z
Assigned to
andrei
Creator
mandeep

Comments

Comment #0 by mandeep — 2011-01-07T19:45:07Z
> Hi, > > Is it possible to point a Variant to an interface. The below code does not compile. > > module testD; > import std.stream; > import std.stdio; > import std.variant; > > interface A { > void func1(); > } > class AC: A { > void func1() { > writeln("func1"); > } > } > int main() { > A a = new AC(); > a.func1(); > Variant b = Variant(a); > return 0; > } > > It says that opEquals is not defined for the interface. > > Thanks & Regards > Mandeep
Comment #1 by andrei — 2011-01-23T20:29:37Z