khaVulture
khaVulture
MModular
Created by khaVulture on 12/24/2023 in #questions
TraitsRequiring Static Methods
What am I doing wrong below? please help. trait HasStaticMethod: @staticmethod fn work(): ... @value struct WashingMachine: @staticmethod fn work(): print("Wash the clothes!") @value struct Cooker: @staticmethod fn work(): print("Cook the food!") fn main(): fn do_workT: HasStaticMethod: T.work() do_work(WashingMachine())
12 replies