parser error for static func access non-static variables
Fix: #38408
(cherry picked from commit ce978517e0
)
This commit is contained in:
parent
4c9ccffad2
commit
55b4e0c44a
@ -7571,6 +7571,10 @@ GDScriptParser::DataType GDScriptParser::_reduce_identifier_type(const DataType
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_get_member_type(base_type, p_identifier, member_type)) {
|
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;
|
return member_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user