Inner class in autoload has two reference when instanced

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Meztli

When i instance a inner class from my autoload whether its in the autoload or another scene i always get two reference.

class Card:
var name: String
var description: String
var energy_cost: int
var effect_one: String
var effect_two: String

func _init(name, description, energy_cost, effect_one, effect_two): = name
	self.description = description
	self.energy_cost = energy_cost
	self.effect_one = effect_one
	self.effect_two = effect_two

# effect
# d = damage
# b = block
# n = none

func _ready():
# create the cards in the game
card_strike ="Strike", "Deal 5 damage", 1, "d5", "n")
card_defend ="Defend", "Gain 5 block", 1, "b5", "n")

when i print it i get this


and when i add it to an array i get this


and when i try to add multiple to an array i get this

[[Reference:1271], [Reference:1271], [Reference:1271], [Reference:1271], [Reference:1271]]
[[Reference:1274], [Reference:1274], [Reference:1274], [Reference:1274], [Reference:1274]]

when the class is not in a autoload i only get one reference, why is this happening and how can i fix it?

Where was card_strike introduced?
I see it is without a varkeyword in code, so it must have been introduced in different scope? It must be there when issue happens

Inces | 2022-12-30 11:57