Using the .append() method on structs

I have the following code:
alias Component = fn() -> None

fn baseComponent(): pass

struct Entity():
    var components: List[Component]

    fn __init__(inout self):
        self.components = List[Component]()

    fn add(self, method: Component):
        self.components.append(method)

However, line 12 gives an error even though I think it should be valid. What is the proper syntax in this case?
Was this page helpful?