mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When an overriding property containing willSet or didSet is not within a type, the type checker could crash due to a missing "self" declaration. Check this condition. Fixes rdar://problem/57040259.
10 lines
152 B
Swift
10 lines
152 B
Swift
// RUN: not %target-swift-frontend -typecheck %s
|
|
class A { }
|
|
class B: A {
|
|
func foo(_: () -> ()) {
|
|
|
|
override var prop: Any? {
|
|
didSet { }
|
|
}
|
|
}
|