Forums

Cobra Internal Error

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Cobra Internal Error

Postby torial » Wed Mar 16, 2011 7:57 pm

When I incorrectly use an Enum ,

textBox.anchor = textBox.anchor or AnchorStyles.Right


I get the following Internal Error:

error: COBRA INTERNAL ERROR / FallThroughException / info=TruthExpr-sh(75266, didBindInh=false, didBindInt=false, didStartBindImp=true, didBindImp=false, token=Token(DOT, '.', '.', ln 52, col 33, C:\Users\seanm\Desktop\Cobra\IDE\Utils.cobra), Treatment=AsIs, type=nil, 75266)


A better messages would be anything from a generic "syntax error at line 52", to "incorrect enum operation, try |" or something like that. Should I write a bug up?
torial
 
Posts: 229
Location: IA

Re: Cobra Internal Error

Postby Charles » Wed Mar 16, 2011 10:55 pm

Looks like we have it in ticket:265 although a different bit of code produced it. Of course, if we fixed the use of enums as truth values to just work then your OR expression becomes valid even though it's clearly not what you intended.

I've added this discussion to the ticket.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Cobra Internal Error

Postby Charles » Sun Sep 23, 2012 5:02 pm

This will now give the error message:

Cannot treat enums as truth values. Compare them to a value with "==" or "<>", or if they are flags, use a bitwise operator ("&", "|", "~").
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 5 guests