[Issue 611] IsExpression fails when inside implemented interface

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 19 12:10:29 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=611


Tim Shea <tim.m.shea at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tim.m.shea at gmail.com


--- Comment #2 from Tim Shea <tim.m.shea at gmail.com> 2012-03-19 12:10:45 PDT ---
Please correct me if I'm wrong, but this does not seem incorrect to me. In
fact, if the static assert compiles and passes outside the interface, I would
think that would be an issue. After all:

interface MyInterface(T) {
  static assert(is(T : MyInterface));
}
MyInterface(int) a;

Should compile to :

interface MyInterface(Int) {
  static assert(is(int : MyInterface(int));
}

This seems self evidently false to me. An integer does not convert to a
MyInterface(int), nor should it. Regardless of where the static assert is, I
would think it should fail.

I guess if you have something like:

interface Cloneable(T) {
  T clone();
}

then it makes sense to say:

class CloneableObject : Cloneable(CloneableObject) {...}

but I don't think it follows that a Cloneable(CloneableObject) should be
convertible back to a plain CloneableObject.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list