Forums

bug when passing delegate to ctor. property initializer

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

bug when passing delegate to ctor. property initializer

Postby jonathandavid » Thu Jan 15, 2009 3:54 am

I've reduced the offending code to this:

class DelegateBug

sig Foo

pro op from var as Foo

def defaultOp is shared
pass

def init
_op = ref .defaultOp


def main is shared

x = DelegateBug()
x.op = ref .defaultOp # this works OK

y = DelegateBug(op = ref .defaultOp) # COMPILER ERROR


The error is in the last line. The error message I get is in Spanish and is quite lengthy, so I let you try it yourself and see what the error looks like in English.

BTW I'm using the latest version from source (0.8.0 post-release).
jonathandavid
 
Posts: 159

Re: bug when passing delegate to ctor. property initializer

Postby jonathandavid » Thu Jan 15, 2009 3:56 am

Don't know what happened to the indentation of the last three lines. They looked right on preview.

[EDIT: Now on FF they look right. Weird, must've been an IE6 thing]
jonathandavid
 
Posts: 159

Re: bug when passing delegate to ctor. property initializer

Postby Charles » Thu Jan 15, 2009 5:27 am

I'll take a look later, but I'm out most of the day so might not be until tomorrow. Apparently you have a workaround in the mean time.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: bug when passing delegate to ctor. property initializer

Postby Charles » Sat Jan 17, 2009 3:55 pm

Fixed, tested and checked in.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: bug when passing delegate to ctor. property initializer

Postby jonathandavid » Sun Jan 18, 2009 2:13 am

Thanks, this will be great for my Prompt class.
jonathandavid
 
Posts: 159

Re: bug when passing delegate to ctor. property initializer

Postby Charles » Sun Jan 18, 2009 7:46 pm

You're welcome.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 28 guests