diff options
author | George Marques <george@gmarqu.es> | 2022-03-30 11:53:49 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2022-03-30 11:58:29 -0300 |
commit | be718285f7d60c12623d53b5f6250733fa667431 (patch) | |
tree | 83022ce7e3c2645c9d669934e60b35408274bd0c /modules/gdscript/gdscript_parser.cpp | |
parent | 118f29694b12d771e67349e4d6838ae479a6552e (diff) | |
download | redot-engine-be718285f7d60c12623d53b5f6250733fa667431.tar.gz |
GDScript: Fix issues with completion and `super` calls
- Make call errors use the call node instead of the calle, which will be
empty on super calls.
- Don't allow `super()` to be used within lambdas.
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 10709d3667..310fc14ecf 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -2752,7 +2752,11 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre pop_multiline(); return nullptr; } - call->function_name = current_function->identifier->name; + if (current_function->identifier) { + call->function_name = current_function->identifier->name; + } else { + call->function_name = SNAME("<anonymous>"); + } } else { consume(GDScriptTokenizer::Token::PERIOD, R"(Expected "." or "(" after "super".)"); make_completion_context(COMPLETION_SUPER_METHOD, call, true); |