Hi!
Very strange problem (and probably easy to solve):
class A: one public constructor.
--> { super (). ... }
class B: inherits from class A, one public constructor
--> { super (). ... }
.p module tries to create new object and gets error "Cannot use NEW statement with class 'xxx' using a protected constructor. (12959)".
I don't have any protected constructors in my code.
Ideas?
What version of OE are you running and were both classes compiled using that version?
Eh, sorry.
OE 11.3.2 @ Linux
Code is fresh and compiled.
Wbr,
Toomas
You are calling super with no parameters. Do you have a public constructor with no parameters for Class A?
Can you post the (real) ABL code? not just the pseudo-code?
-- peter
Why is there a super() in Class A if it doesn't inherit from anything?
schas: yes, I have public constructor with no parameters in Class A .
Thomas: because PDS generates such a code?
Peter: full code is too big to post it here. But you can trust me, there is no protected constructor. :-)
I have strange feeling that this problem is somehow related to how our code is compiled & cached in client side.
Because same code worked yesterday, but started to fail occasionally today ie sometimes it worked, sometimes not.
I'll investigate this theory further.
Wbr,
Toomas
schas: yes, I have public constructor with no parameters in Class A .
Thomas: because PDS generates such a code?
Peter: full code is too big to post it here. But you can trust me, there is no protected constructor. :-)
I have strange feeling that this problem is somehow related to how our code is compiled & cached in client side.
Because same code worked yesterday, but started to fail occasionally today ie sometimes it worked, sometimes not.
I'll investigate this theory further.
Wbr,
Toomas
Flag this post as spam/abuse.
So, Peter, why *does* PDSOE generate that super()?
So, Peter, why *does* PDSOE generate that super()?
Flag this post as spam/abuse.
Understood. Let me ask this.
Is there any difference in the sequence of operations if it is there or not?
Does it make any sense or have any impact to have that top level super somewhere other than the first statement?
> Does it make any sense or have any impact to have that top level super somewhere other than the first statement?
Understood. Let me ask this.
Is there any difference in the sequence of operations if it is there or not?
Does it make any sense or have any impact to have that top level super somewhere other than the first statement?
Flag this post as spam/abuse.
I.e., it makes no difference whether there or not, exactly the same thing is going to happen. I can see why it should be there in the subclass because it makes the relationship explicit, not to mention that one often wants to pass through a parameter. I understand that technically the same is true with Pro.Lang.Object, but it seems less valuable there.