Bug 15868 – Inappropriate error message: "base type must be class or interface" (and it is)
Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-04-04T00:54:00Z
Last change time
2017-07-02T13:50:05Z
Assigned to
nobody
Creator
andy.pj.hanson
Comments
Comment #0 by andy.pj.hanson — 2016-04-04T00:54:12Z
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`.)
Comment #1 by dlang-bugzilla — 2017-07-02T13:50:05Z