You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Merge pull request #35412 from DaividFrank/check_overriding_self
Disabled re-assigning 'self'
This commit is contained in:
@@ -1868,6 +1868,10 @@ GDScriptParser::Node *GDScriptParser::_reduce_expression(Node *p_node, bool p_to
|
|||||||
_set_error("Can't assign to constant", tokenizer->get_token_line() - 1);
|
_set_error("Can't assign to constant", tokenizer->get_token_line() - 1);
|
||||||
error_line = op->line;
|
error_line = op->line;
|
||||||
return op;
|
return op;
|
||||||
|
} else if (op->arguments[0]->type == Node::TYPE_SELF) {
|
||||||
|
_set_error("Can't assign to self.", op->line);
|
||||||
|
error_line = op->line;
|
||||||
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (op->arguments[0]->type == Node::TYPE_OPERATOR) {
|
if (op->arguments[0]->type == Node::TYPE_OPERATOR) {
|
||||||
@@ -6290,6 +6294,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
|
|||||||
node_type.has_type = true;
|
node_type.has_type = true;
|
||||||
node_type.kind = DataType::CLASS;
|
node_type.kind = DataType::CLASS;
|
||||||
node_type.class_type = current_class;
|
node_type.class_type = current_class;
|
||||||
|
node_type.is_constant = true;
|
||||||
} break;
|
} break;
|
||||||
case Node::TYPE_IDENTIFIER: {
|
case Node::TYPE_IDENTIFIER: {
|
||||||
IdentifierNode *id = static_cast<IdentifierNode *>(p_node);
|
IdentifierNode *id = static_cast<IdentifierNode *>(p_node);
|
||||||
|
|||||||
Reference in New Issue
Block a user