Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change GDScript tests to use InstancePlaceholder as the example abstract class #79524

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
func test():
CanvasItem.new()
InstancePlaceholder.new()
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GDTEST_ANALYZER_ERROR
Native class "CanvasItem" cannot be constructed as it is abstract.
Native class "InstancePlaceholder" cannot be constructed as it is abstract.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class A extends CanvasItem:
class A extends InstancePlaceholder:
func _init():
print('no')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GDTEST_ANALYZER_ERROR
Class "abstract_script_instantiate.gd::B" cannot be constructed as it is based on abstract native class "CanvasItem".
Class "abstract_script_instantiate.gd::B" cannot be constructed as it is based on abstract native class "InstancePlaceholder".
4 changes: 2 additions & 2 deletions scene/main/canvas_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class CanvasItem : public Node {
_FORCE_INLINE_ void set_hide_clip_children(bool p_value) { hide_clip_children = p_value; }

GDVIRTUAL0(_draw)

public:
enum {
NOTIFICATION_TRANSFORM_CHANGED = SceneTree::NOTIFICATION_TRANSFORM_CHANGED, //unique
Expand All @@ -179,7 +180,6 @@ class CanvasItem : public Node {
NOTIFICATION_EXIT_CANVAS = 33,
NOTIFICATION_LOCAL_TRANSFORM_CHANGED = 35,
NOTIFICATION_WORLD_2D_CHANGED = 36,

};

/* EDITOR */
Expand All @@ -189,7 +189,7 @@ class CanvasItem : public Node {

// Save and restore a CanvasItem state
virtual void _edit_set_state(const Dictionary &p_state) {}
virtual Dictionary _edit_get_state() const { return Dictionary(); };
virtual Dictionary _edit_get_state() const { return Dictionary(); }

// Used to move the node
virtual void _edit_set_position(const Point2 &p_position) = 0;
Expand Down