- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
[netbeans] default constructor argument and companion object => false error
Mon, 2009-10-19, 17:04
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)
Tue, 2009-10-20, 09:27
#2
Re: [netbeans] default constructor argument and companion objec
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?
Tue, 2009-10-20, 15:47
#3
Re: [netbeans] default constructor argument and companion obje
It happens sometimes, so, maybe it's a bug from scalac, but I have not
verified it yet.
--Caoyuan
>
>
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