Page 1 of 1

bug when passing delegate to ctor. property initializer

PostPosted: Thu Jan 15, 2009 3:54 am
by jonathandavid
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).

Re: bug when passing delegate to ctor. property initializer

PostPosted: Thu Jan 15, 2009 3:56 am
by jonathandavid
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]

Re: bug when passing delegate to ctor. property initializer

PostPosted: Thu Jan 15, 2009 5:27 am
by Charles
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.

Re: bug when passing delegate to ctor. property initializer

PostPosted: Sat Jan 17, 2009 3:55 pm
by Charles
Fixed, tested and checked in.

Re: bug when passing delegate to ctor. property initializer

PostPosted: Sun Jan 18, 2009 2:13 am
by jonathandavid
Thanks, this will be great for my Prompt class.

Re: bug when passing delegate to ctor. property initializer

PostPosted: Sun Jan 18, 2009 7:46 pm
by Charles
You're welcome.