GDScript: Allow using self in lambdas

This commit is contained in:
George Marques 2022-04-20 14:22:22 -03:00
parent 690fefe43e
commit 01d13ab2c1
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
16 changed files with 251 additions and 23 deletions

View file

@ -2200,9 +2200,6 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_self(ExpressionNode *p_pre
if (current_function && current_function->is_static) {
push_error(R"(Cannot use "self" inside a static function.)");
}
if (in_lambda) {
push_error(R"(Cannot use "self" inside a lambda.)");
}
SelfNode *self = alloc_node<SelfNode>();
self->current_class = current_class;
return self;