Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

local type definition in a class causing problem in inheritance

Former Member
0 Likes
1,563

Hi,

Situation :

A class with local type defined (by adding code after clicking local types button in se24 - class builder, but NOT in either public or private or protected sections) . This class has private data member of that defined type and also has a public method using that private member. This class is activated and has no problems.

Created a subclass, inheriting the above mentioned class.

Problem :

When I do syntax check or try to activate the created subclass , I get syntax error saying - type unknown in parent class.

Whereas if type definition is coded in either public or private or protected section of parent class then its subclass can be activated with no errors.

Do any know :

The reason for syntax error ?

Differences in defining types in place after clicking local types button in se24 and that of defining types in either public or private or protected sections of the class ?

Thanks in advance,

Chan

Hi,

Situation :

A class with local type defined (by adding code after clicking local types button in se24 - class builder, but NOT in either public or private or protected sections) . This class has private data member of that defined type and also has a public method using that private member. This class is activated and has no problems.

Created a subclass, inheriting the above mentioned class.

Problem :

When I do syntax check or try to activate the created subclass , I get syntax error saying - type unknown in parent class.

Whereas if type definition is coded in either public or private or protected section of parent class then its subclass can be activated with no errors.

Do any know :

The reason for syntax error ?

Differences in defining types in place after clicking local types button in se24 and that of defining types in either public or private or protected sections of the class ?

Thanks in advance,

Chan

1 REPLY 1
Read only

uwe_schieferstein
Active Contributor
0 Likes
707

Hello Chandu

>

> Situation :

> A class with local type defined (by adding code after clicking local types button in se24 - class builder, but NOT in either public or private or protected sections) . This class has private data member of that defined type and also has a public method using that private member. This class is activated and has no problems.

This is already not possible on my system (ECC 6.0). I declared a private type and used it in a public method. Trying to activate the class results in error message:

In the PUBLIC SECTION you may only refer to global types when typing parameters. Parameter "..." is local.

Private attributes and methods using private local types are no problem because they are neither inherited nor visible externally.

Protected local types and protected attributes / methods should work as well.

However, public attributes and methods require public local types (= global types).

Regards

Uwe