561 – Incorrect duplicate error message when trying to create instance of interface

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 561 - Incorrect duplicate error message when trying to create instance of interface
Summary: Incorrect duplicate error message when trying to create instance of interface
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P3 minor
Assignee: Walter Bright
URL:
Keywords: diagnostic, patch
Depends on:
Blocks:
Reported: 2006年11月18日 10:38 UTC by Matti Niemenmaa
Modified: 2014年02月15日 13:22 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2006年11月18日 10:38:54 UTC
interface D
{
 void foo();
}
void main() {
	D d = new D();
}
The above code errors out with:
asdf.d(7): Error: cannot create instance of interface D
asdf.d(7): Error: cannot create instance of abstract class D
Huh? Abstract class? That's an interface, not an abstract class. The first error message is expected, the second is both incorrect and superfluous.
Comment 1 Matti Niemenmaa 2006年11月18日 10:47:06 UTC
Damn typos.
Comment 2 Matti Niemenmaa 2007年03月23日 12:22:04 UTC
This should be easy to fix. expression.c, line 2756, change from:
if (cd->isAbstract())
To:
else if (cd->isAbstract())
Comment 3 Walter Bright 2007年07月30日 15:46:52 UTC
Fixed DMD 1.019 and 2.003


AltStyle によって変換されたページ (->オリジナル) /