mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
GDScript: Allow using self in lambdas
This commit is contained in:
parent
690fefe43e
commit
01d13ab2c1
16 changed files with 251 additions and 23 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue