D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6485 - interface + abstract class fails on linking
Summary: interface + abstract class fails on linking
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-12 14:47 UTC by Carlos Ballesteros Velasco
Modified: 2013-01-26 07:57 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Carlos Ballesteros Velasco 2011-08-12 14:47:24 UTC
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 Andrej Mitrovic 2013-01-26 07:57:22 UTC
A.test can be defined externally in another object file, that's why it's a linker error.