Assertion failed on invalid use of enum bit flags

Started by
2 comments, last by WitchLord 1 year, 3 months ago

As reported here: https://github.com/openplanet-nl/issues/issues/45

The following code causes an assertion failure:

enum Foo {
	A = (1 << 0),
	B = (1 << 1),
}
void Test(int f) {}
void Main() {
	Test(Foo::A = true | Foo::B);
}

The assertion hit is here: https://github.com/codecat/angelscript-mirror/blob/6888f245e61d7cd2728e7f3f0e088dcec4e22066/sdk/angelscript/source/as_compiler.cpp#L16282

Obviously it is invalid syntax that doesn't really make sense, but the assertion probably shouldn't be thrown.

Advertisement

Thanks for reporting this. I'll look into it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this old bug now in revision 2822.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement