Skip to content

SwiftData class: Method does not override any method from its superclass #56

Description

@ashleydw

If a SwiftData model annotation is added to a class, the build will fail with "Method does not override any method from its superclass".

It can be reproduced using a clean SwiftData project, adding the SPM package from 1.2.1, and the following class:

import Foundation
import SwiftData
import MetaCodable
import HelperCoders

protocol MyProtocol {
    
}

@Codable
@Model
final class Item : MyProtocol {
    @CodedAt("timestamp")
    var timestamp: Date? = nil
    
    init() { }
}

Expanding the macro actually shows it doesn't add the super.* calls:

image

I have however managed to produce one expansion with the error:

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions