Page 1 of 1

Cobra Internal Error on def init

PostPosted: Wed Feb 20, 2008 6:37 pm
by dennis
I received an error:

Code: Select all
error: COBRA INTERNAL ERROR / IndexOutOfRangeException / Index was outside the bounds of the array.


so, by process of elimination, I whittled the code down to this:

class Abc

def init(_ghi as int)


When I compile just this, I also get the internal error.

The source of the problem is the underscore, but the compiler should handle this better.

Re: Cobra Internal Error on def init

PostPosted: Wed Feb 20, 2008 6:50 pm
by Charles
Confirmed and will fix for next release (expected some time next week).

As you pointed out, the work around is to remove the underscore.

I think I can also improve Cobra to give the line number of the last AST node it processed meaning that in the future such errors will be easier to find. There is actually code for this, but it doesn't work in enough circumstances.

Thanks for the report.

Re: Cobra Internal Error on def init

PostPosted: Wed Feb 20, 2008 8:42 pm
by dennis
I had hoped the verbosity switch might help me track down the error message. I almost certainly won't try 5 again. :lol:

Would it be possible to turn on verbose output only for a particular phase of compilation? For example, I didn't want to see all the types, etc., scrolling by.

I'm sorry, I'm not well-versed on compiler technology.

Re: Cobra Internal Error on def init

PostPosted: Wed Feb 20, 2008 9:45 pm
by Charles
We could certainly put labels on various types of output and then specify those on the command line. Maybe that is something people can work after the source is opened up next week because I imagine I'll be too busy on fixes and gaps to get to this any time soon.

I get by alright with putting in temporary "trace" statements where I suspect they are needed.