Warn when dynamically subclassing a static class
Opened this issue · 0 comments
vihanb commented
Certain classes are 'static' for design purposes. This means that with this class:
@dynamic(false)
public class Animal {
// ...
func makeSound() { ... }
}
The following should warn:
public class Dog: Animal {
override public func makeSound() { ... }
}
Warning: Subclass of a static class cannot be dynamic, add `@dynamic(false)` (1:0)
> 1 | public class Dog: Animal {
| ^
2 | override public func makeSound() { ... }
3 | }