Any reason of "@objc is not supported within extensions of generic classes." ?

I was trying to implement a final class to conform NSCopying by extension.
List<T> was a class in Realm object database.

final class List<T>

My implementation:

extension List:NSCopying {
    public func copy(with zone: NSZone? = nil) -> Any {
        ...
    }
}

I got an error called "@objc is not supported within extensions of generic
classes.". Any idea why there is a limitation of this? Thanks.

Zhaoxin

1 Like