www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15868] New: Inappropriate error message: "base type must be


          Issue ID: 15868
           Summary: Inappropriate error message: "base type must be class
                    or interface" (and it is)
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andy.pj.hanson gmail.com

This bug requires multiple modules to reproduce.


    import cls : Cls;
    void main() {}


    import ifc : Ifc;
    class Cls : Ifc {}


    import cls : Cls;
    interface Ifc {}

    // This class causes the error,
    // but it isn't mentioned in the error message.
    class ClsHolder {Cls.Cls cls;}

The error message is:
    src/cls.d(2,1): Error: class cls.Cls base type must be class or interface,
not Ifc

A better message would be something like: `src/ifc.d(6,20): Error: symbol
Cls.Cls not found.`
(The error will disappear if ClsHolder is changed from using `Cls.Cls` to just

Apr 03 2016