Bug 6485 – interface + abstract class fails on linking

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2011-08-12T14:47:00Z
Last change time
2013-01-26T07:57:22Z
Assigned to
nobody
Creator
soywiz

Comments

Comment #0 by soywiz — 2011-08-12T14:47:24Z
If you have to mark the method as abstract, it should produce an error while compiling, not on linking. I had to figure out the problem because I didn't get any error when compiling. On big projects have descriptive errors is a must. //version = WORKS; interface I { void test(); } abstract class A : I { version (WORKS) { // Works abstract void test(); } else { // Error 42: Symbol Undefined _D2aa1A4testMFZv void test(); } } class B : A { void test() { } } int main(string[] args) { return 0; }
Comment #1 by andrej.mitrovich — 2013-01-26T07:57:22Z
A.test can be defined externally in another object file, that's why it's a linker error.