Forums

internal error when incorrectly casing member

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

internal error when incorrectly casing member

Postby gauthier » Fri Dec 12, 2008 6:15 am

I get internal error when compiling this code

class WritingStuff
def doThat
tw = StringWriter()
tw.writeline #this is generating the error

class Test
def main is shared
w = WritingStuff()
w.doThat


By the way, is there a compiler trace feature that output each line number before an internal exception occurs or such functionality? I got this bug in a 500 line file and it would help to track down where the parsing choke.
Last edited by gauthier on Sat Dec 13, 2008 4:15 am, edited 1 time in total.
gauthier
 
Posts: 116

Re: getting internal error

Postby jonathandavid » Fri Dec 12, 2008 6:29 am

Yes, there seems to be something rather wrong about StringBuilder.writeline.

The following fails too (and produces the longest error message I've ever seen):

class Test
def main is shared
StringWriter().writeline('')


Interestingly, this works:

class Test
def main is shared
StringWriter().write('')
jonathandavid
 
Posts: 159

Re: getting internal error

Postby gauthier » Fri Dec 12, 2008 7:07 am

that's all it takes to catch typo, the actual method name is WriteLine so it should called writeLine!
gauthier
 
Posts: 116

Re: getting internal error

Postby jonathandavid » Fri Dec 12, 2008 9:44 am

That's weird, I would've expected a more "friendly" error from the cobra compiler for such a simple error (misspelling a method's name)

So it looks like I was of help even if that wasn't my intention :lol:
jonathandavid
 
Posts: 159

Re: getting internal error

Postby Charles » Fri Dec 12, 2008 10:58 am

I'll take a look later today. Have to bust out the rent right now...
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: getting internal error

Postby Charles » Sat Dec 13, 2008 12:26 am

Fixed in changeset:1824.

-- The internal error messages are now truncated to 1024 chars.

-- This bug happened if you (1) spelled the member name correctly, (2) got the case wrong and (3) it was a member overload.

-- Regarding the line number, we have this for internal errors in the parser but not for the subsequent phases of the compiler.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: internal error when incorrectly casing member

Postby jonathandavid » Sat Dec 13, 2008 4:42 am

Chuck wrote:This bug happened if you (1) spelled the member name correctly, (2) got the case wrong and (3) it was a member overload.


Wow, that was some ace bug finding on gauthier's part :lol:
jonathandavid
 
Posts: 159


Return to Discussion

Who is online

Users browsing this forum: No registered users and 26 guests