1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #38412 from ThakeeNathees/static-func-var-access

parser error for static func access non-static variables
This commit is contained in:
Rémi Verschelde
2020-05-09 21:32:28 +02:00
committed by GitHub

View File

@@ -7571,6 +7571,10 @@ GDScriptParser::DataType GDScriptParser::_reduce_identifier_type(const DataType
}
if (_get_member_type(base_type, p_identifier, member_type)) {
if (!p_base_type && current_function && current_function->_static) {
_set_error("Can't access member variable (\"" + p_identifier.operator String() + "\") from a static function.", p_line);
return DataType();
}
return member_type;
}