1627 – ICE with a method called _ctor

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1627 - ICE with a method called _ctor
Summary: ICE with a method called _ctor
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
Reported: 2007年10月30日 16:13 UTC by Matti Niemenmaa
Modified: 2014年02月24日 15:33 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 2007年10月30日 16:13:23 UTC
class Foo {
	void _ctor() {}
}
void main() {
	Foo f = new Foo();
}
asdf.d(2): function asdf.Foo._ctor expected to return a value of type int
Assertion failure: 'member' on line 3208 in file 'expression.c'
http://www.digitalmars.com/d/1.0/lex.html states that "[i]dentifiers starting with __ (two underscores) are reserved". This code probably fails because DMD uses the name _ctor for constructors. Either that should be __ctor or names starting with only one underscore should also be reserved.
In any case, an ICE shouldn't result.
Comment 1 Matti Niemenmaa 2007年10月30日 17:11:20 UTC
(In reply to comment #0)
> asdf.d(2): function asdf.Foo._ctor expected to return a value of type int
Oops! Disregard that, the code as posted doesn't result in that error message, only the ICE.
Comment 2 Matti Niemenmaa 2008年09月03日 01:18:12 UTC
Changed in DMD 1.035 such that _ctor is reserved. A quick look doesn't give me anything in the docs about it but I'll leave this as a FIXED ice-on-invalid-code.
Comment 3 Walter Bright 2008年09月03日 01:33:15 UTC
Fixed dmd 1.035 and 2.019


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