[scala-tools] [netbeans] default constructor argument and companion object => false error

View: New views
4 Messages — Rating Filter:   Alert me  

[scala-tools] [netbeans] default constructor argument and companion object => false error

by Andrew Gaydenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Caoyuan,

For such code

object OC
class OC(v : Int = 1)

I have second line marked as an error with error's popup:

"constructor definition not allowed here
 constructor OC is defined twice
 constructor OC is defined twice"

(all things are from trunks, as always)

Re: [scala-tools] [netbeans] default constructor argument and companion object => false error

by dcaoyuan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Andrew Gaydenko wrote:
Caoyuan,

For such code

object OC
class OC(v : Int = 1)

I have second line marked as an error with error's popup:

"constructor definition not allowed here
 constructor OC is defined twice
 constructor OC is defined twice"

(all things are from trunks, as always)
I noticed that before, It seems to be related to scalac. You can move "object OC" to behind "class OC ..." definition to avoid it.

-Caoyuan

Re: [scala-tools] [netbeans] default constructor argument and companion object => false error

by Andrew Gaydenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 20 October 2009 08:14:04 dcaoyuan wrote:

> Andrew Gaydenko wrote:
> > Caoyuan,
> >
> > For such code
> >
> > object OC
> > class OC(v : Int = 1)
> >
> > I have second line marked as an error with error's popup:
> >
> > "constructor definition not allowed here
> >  constructor OC is defined twice
> >  constructor OC is defined twice"
> >
> > (all things are from trunks, as always)
>
> I noticed that before, It seems to be related to scalac. You can move
> "object OC" to behind "class OC ..." definition to avoid it.

Caoyuan, sorry, it isn't clear to me. Do you mean, scalac has a bug?


Re: [scala-tools] [netbeans] default constructor argument and companion object => false error

by dcaoyuan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 20, 2009 at 4:26 PM, Andrew Gaydenko <a@...> wrote:

> On Tuesday 20 October 2009 08:14:04 dcaoyuan wrote:
>> Andrew Gaydenko wrote:
>> > Caoyuan,
>> >
>> > For such code
>> >
>> > object OC
>> > class OC(v : Int = 1)
>> >
>> > I have second line marked as an error with error's popup:
>> >
>> > "constructor definition not allowed here
>> >  constructor OC is defined twice
>> >  constructor OC is defined twice"
>> >
>> > (all things are from trunks, as always)
>>
>> I noticed that before, It seems to be related to scalac. You can move
>> "object OC" to behind "class OC ..." definition to avoid it.
>
> Caoyuan, sorry, it isn't clear to me. Do you mean, scalac has a bug?

It happens sometimes, so, maybe it's a bug from scalac, but I have not
verified it yet.

--Caoyuan

>
>