| 1 |
# Test access visibility of parent elements in nested class architectures. |
| 2 |
class Parent: |
| 3 |
const parent_const := 1 |
| 4 |
|
| 5 |
var parent_variable := 2 |
| 6 |
|
| 7 |
@warning_ignore("unused_signal") |
| 8 |
signal parent_signal |
| 9 |
|
| 10 |
var parent_attribute: int: |
| 11 |
get: |
| 12 |
return 3 |
| 13 |
|
| 14 |
func parent_func(): |
| 15 |
return 4 |
| 16 |
|
| 17 |
class Nested: |
| 18 |
const nested_const := 5 |
| 19 |
|
| 20 |
|
| 21 |
class Child extends Parent: |
| 22 |
func child_test(): |
| 23 |
print(parent_const) |
| 24 |
print(self.parent_const) |
| 25 |
print(parent_variable) |
| 26 |
print(self.parent_variable) |
| 27 |
print(parent_signal.get_name()) |
| 28 |
print(self.parent_signal.get_name()) |
| 29 |
print(parent_attribute) |
| 30 |
print(self.parent_attribute) |
| 31 |
print(parent_func.get_method()) |
| 32 |
print(self.parent_func.get_method()) |
| 33 |
print(parent_func()) |
| 34 |
print(self.parent_func()) |
| 35 |
print(Nested.nested_const) |
| 36 |
print(self.Nested.nested_const) |
| 37 |
print(Parent.Nested.nested_const) |
| 38 |
|
| 39 |
|
| 40 |
func test(): |
| 41 |
Child.new().child_test() |