The declaration of value
below
import Foundation
class AAA: NSObject {
func test2() {
self.dynamicType
}
}
extension AAA {
stat
I just stumbled over the same issue with a different cause and would like to post it here for other people experiencing the same useless error message.
A final class which overrides a computed variable defined in an extension also causes this error. It works for functions though and thus looks like a compiler bug.
// at line 0: a declaration cannot be both 'final' and 'dynamic'
import UIKit
extension UIViewController {
var test: Int { return 0 }
}
final class TestController: UIViewController {
override var test: Int { return 1 }
}