[Issue 15868] New: Inappropriate error message: "base type must be class or interface" (and it is)
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Sun Apr  3 17:54:12 PDT 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15868
          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 at puremagic.com
          Reporter: andy.pj.hanson at gmail.com
This bug requires multiple modules to reproduce.
app.d:
    import cls : Cls;
    void main() {}
cls.d:
    import ifc : Ifc;
    class Cls : Ifc {}
ifc.d:
    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
`Cls`.)
--
    
    
More information about the Digitalmars-d-bugs
mailing list