diff options
| author | George Marques <george@gmarqu.es> | 2024-04-25 21:05:53 -0300 |
|---|---|---|
| committer | George Marques <george@gmarqu.es> | 2024-04-25 21:19:40 -0300 |
| commit | 7ca038effa28c1767e43e4f66d2bd9f34852d5b7 (patch) | |
| tree | 675756d2d51d2bc53a0a33478a75d85aca45c03f /modules/gdscript/tests/scripts | |
| parent | 11d3768132582d192b8464769f26b493ae822321 (diff) | |
| download | redot-engine-7ca038effa28c1767e43e4f66d2bd9f34852d5b7.tar.gz | |
GDScript: Perform validated calls with static methods
When the types are validated at compile time, this type of call runs
faster. It is already used for instance methods, this adds this
optimization to native static methods as well.
Diffstat (limited to 'modules/gdscript/tests/scripts')
| -rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd | 7 | ||||
| -rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.out | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd b/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd new file mode 100644 index 0000000000..35e4dbd6a0 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd @@ -0,0 +1,7 @@ +func test(): + # Validated native static call with return value. + print(FileAccess.file_exists("some_file")) + + # Validated native static call without return value. + Node.print_orphan_nodes() + diff --git a/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.out b/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.out new file mode 100644 index 0000000000..44302c8137 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.out @@ -0,0 +1,2 @@ +GDTEST_OK +false |
