www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - BUG: Assertion failure

reply h3r3tic <foo bar.baz> writes:
This code contains an error, operator !== should be used instead of != 
in the findNode() function (problem doesn't show up then)
Yet dmd.109 reports something else ;)

 Assertion failure: 'ident' on line 611 in file 'dsymbol.c'
interface INode { INode owner(); } class BasicNode : INode { INode findNode() { foreach(INode c; m_children) if (c.owner != this) continue; return null; } INode[] m_children; } The result is exactly the same if the owner() function is implemented in the BasicNode class.
Dec 26 2004
next sibling parent "Thomas Kuehne" <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Added to DStress as
http://dstress.kuehne.cn/nocompile/bug_dsymbol_611_A.d
http://dstress.kuehne.cn/nocompile/bug_dsymbol_611_B.d
http://dstress.kuehne.cn/compile/bug_dsymbol_611_C.d

Thomas
-----BEGIN PGP SIGNATURE-----

iD8DBQFBzyyD3w+/yD4P9tIRArJIAJ4l5IMXQbKhOR7eYrpDK199E/6JjQCfbw8L
C2pgWuPJStEt9MyWk1Jd4JU=
=EaSw
-----END PGP SIGNATURE-----
Dec 26 2004
prev sibling parent reply "Simon Buchan" <talk n.g> writes:
On Sun, 26 Dec 2004 16:24:08 +0100, h3r3tic <foo bar.baz> wrote:

 This code contains an error, operator !== should be used instead of !=
 in the findNode() function (problem doesn't show up then)
 Yet dmd.109 reports something else ;)

  > Assertion failure: 'ident' on line 611 in file 'dsymbol.c'


 interface INode
 {
 	INode		owner();
 }


 class BasicNode : INode
 {
 	INode findNode()
 	{
 		foreach(INode c; m_children)
 			if (c.owner != this) continue;
 		return null;
 	}
 	
 	INode[]	m_children;
 }

 The result is exactly the same if the owner() function is implemented in
 the BasicNode class.
I was under the impression that the identifier token === (and its negative !==) were replaced by 'is' (and !(foo is bar))
Dec 28 2004
parent reply h3r3tic <foo bar.baz> writes:
Simon Buchan wrote:
 On Sun, 26 Dec 2004 16:24:08 +0100, h3r3tic <foo bar.baz> wrote:
 
 This code contains an error, operator !== should be used instead of !=
 in the findNode() function (problem doesn't show up then)
 Yet dmd.109 reports something else ;)

  > Assertion failure: 'ident' on line 611 in file 'dsymbol.c'


 interface INode
 {
     INode        owner();
 }


 class BasicNode : INode
 {
     INode findNode()
     {
         foreach(INode c; m_children)
             if (c.owner != this) continue;
         return null;
     }
     
     INode[]    m_children;
 }

 The result is exactly the same if the owner() function is implemented in
 the BasicNode class.
I was under the impression that the identifier token === (and its negative !==) were replaced by 'is' (and !(foo is bar))
Not replaced. They're alternatives. Anyway it was not a typo in the code so the '=' versus '==' versus '===' problem doesn't apply here ;) Anyways, why hasn't the 'a aint b' operator been adopted instead of '!(a is b)' ? Maybe I should add it to my preprocessor :)
Dec 28 2004
parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
h3r3tic wrote:

 Anyways, why hasn't the 'a aint b' operator been adopted instead of '!(a 
 is b)' ? Maybe I should add it to my preprocessor :)
Shouldn't that be "isnt" ? (since "isn't" is a keyword nightmare) I'm not really sure that D needs any more english operators, though... (and there are plenty before that one: "unless", "and", "or", "not") --anders
Dec 28 2004