Reply to 'main' attribute cannot be used in a module that contains top-level code @stilakid You should change name of file main.swift and you got no error for 'main attribute can't be used in module that contains top-level code.' Programming Languages Swift Oct ’23