From 051ef479c93c0c830b60059e3dabed6fc381cdd6 Mon Sep 17 00:00:00 2001 From: TechnoPorg Date: Tue, 25 Jan 2022 08:37:41 -0700 Subject: Allow method binds to take Object subclasses as arguments This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object. This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary. A few small changes also had to be made to other files, due to the changes cascading down all the includes. --- modules/gdscript/language_server/gdscript_workspace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gdscript/language_server') diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index a944844226..a627eca45d 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -585,7 +585,7 @@ void GDScriptWorkspace::completion(const lsp::CompletionParams &p_params, List(stack.pop_back()); Ref script = current->get_script(); if (script.is_valid() && script->get_path() == path) { break; -- cgit v1.2.3