diff options
author | George Marques <george@gmarqu.es> | 2021-10-14 10:12:52 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 10:12:52 -0300 |
commit | bf322bacdd99cdb81bd7870b0b196ef01652581c (patch) | |
tree | c204bfe6333f3dd0aff33d624011f7d8047ccafa /modules/gdscript/tests/scripts/analyzer/features | |
parent | d952a84c3eb1a7d30530d594bb93f75cc562fcb5 (diff) | |
parent | 0ff0f64cd4009700f8f95db865320dc154349dff (diff) |
Merge pull request #53726 from briansemrau/gd-outer-class
GDScript 2.0: Access outer scope classes
Diffstat (limited to 'modules/gdscript/tests/scripts/analyzer/features')
-rw-r--r-- | modules/gdscript/tests/scripts/analyzer/features/class_from_parent.gd | 19 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/analyzer/features/class_from_parent.out | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/class_from_parent.gd b/modules/gdscript/tests/scripts/analyzer/features/class_from_parent.gd new file mode 100644 index 0000000000..30e7deb05a --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/class_from_parent.gd @@ -0,0 +1,19 @@ +class A: + var x = 3 + +class B: + var x = 4 + +class C: + var x = 5 + +class Test: + var a = A.new() + var b: B = B.new() + var c := C.new() + +func test(): + var test_instance := Test.new() + prints(test_instance.a.x) + prints(test_instance.b.x) + prints(test_instance.c.x) diff --git a/modules/gdscript/tests/scripts/analyzer/features/class_from_parent.out b/modules/gdscript/tests/scripts/analyzer/features/class_from_parent.out new file mode 100644 index 0000000000..a078e62cc7 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/features/class_from_parent.out @@ -0,0 +1,4 @@ +GDTEST_OK +3 +4 +5 |