You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
GDScript: Add error when exporting node in non [Node]-derived classes
This commit is contained in:
@@ -910,7 +910,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
|
||||
for (GDScriptParser::AnnotationNode *&E : member_node->annotations) {
|
||||
if (E->name == SNAME("@warning_ignore")) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, member.variable);
|
||||
E->apply(parser, member.variable, p_class);
|
||||
}
|
||||
}
|
||||
for (GDScriptWarning::Code ignored_warning : member_node->ignored_warnings) {
|
||||
@@ -933,7 +933,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
|
||||
for (GDScriptParser::AnnotationNode *&E : member.variable->annotations) {
|
||||
if (E->name != SNAME("@warning_ignore")) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, member.variable);
|
||||
E->apply(parser, member.variable, p_class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -985,7 +985,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
|
||||
// Apply annotations.
|
||||
for (GDScriptParser::AnnotationNode *&E : member.constant->annotations) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, member.constant);
|
||||
E->apply(parser, member.constant, p_class);
|
||||
}
|
||||
} break;
|
||||
case GDScriptParser::ClassNode::Member::SIGNAL: {
|
||||
@@ -1015,7 +1015,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
|
||||
// Apply annotations.
|
||||
for (GDScriptParser::AnnotationNode *&E : member.signal->annotations) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, member.signal);
|
||||
E->apply(parser, member.signal, p_class);
|
||||
}
|
||||
} break;
|
||||
case GDScriptParser::ClassNode::Member::ENUM: {
|
||||
@@ -1063,13 +1063,13 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class,
|
||||
// Apply annotations.
|
||||
for (GDScriptParser::AnnotationNode *&E : member.m_enum->annotations) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, member.m_enum);
|
||||
E->apply(parser, member.m_enum, p_class);
|
||||
}
|
||||
} break;
|
||||
case GDScriptParser::ClassNode::Member::FUNCTION:
|
||||
for (GDScriptParser::AnnotationNode *&E : member.function->annotations) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, member.function);
|
||||
E->apply(parser, member.function, p_class);
|
||||
}
|
||||
resolve_function_signature(member.function, p_source);
|
||||
break;
|
||||
@@ -1279,7 +1279,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class, co
|
||||
// Apply annotations.
|
||||
for (GDScriptParser::AnnotationNode *&E : member.function->annotations) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, member.function);
|
||||
E->apply(parser, member.function, p_class);
|
||||
}
|
||||
resolve_function_body(member.function);
|
||||
} else if (member.type == GDScriptParser::ClassNode::Member::VARIABLE && member.variable->property != GDScriptParser::VariableNode::PROP_NONE) {
|
||||
@@ -1301,7 +1301,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class, co
|
||||
} else if (member.type == GDScriptParser::ClassNode::Member::GROUP) {
|
||||
// Apply annotation (`@export_{category,group,subgroup}`).
|
||||
resolve_annotation(member.annotation);
|
||||
member.annotation->apply(parser, nullptr);
|
||||
member.annotation->apply(parser, nullptr, p_class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1837,7 +1837,7 @@ void GDScriptAnalyzer::resolve_suite(GDScriptParser::SuiteNode *p_suite) {
|
||||
// Apply annotations.
|
||||
for (GDScriptParser::AnnotationNode *&E : stmt->annotations) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, stmt);
|
||||
E->apply(parser, stmt, nullptr);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
@@ -5544,7 +5544,7 @@ Error GDScriptAnalyzer::analyze() {
|
||||
// Apply annotations.
|
||||
for (GDScriptParser::AnnotationNode *&E : parser->head->annotations) {
|
||||
resolve_annotation(E);
|
||||
E->apply(parser, parser->head);
|
||||
E->apply(parser, parser->head, nullptr);
|
||||
}
|
||||
|
||||
resolve_interface();
|
||||
|
||||
Reference in New Issue
Block a user