mirror of
https://github.com/apple/swift.git
synced 2026-10-04 11:58:22 +02:00
We've had several bugs lately where SILGen produces a diagnostic, but the resulting invalid SIL causes crashes further down in the mandatory pipeline. To prevent this from happening, just stop after SILGen if diagnostics were emitted, even if lazy type checking is disabled, because the same rationale applies in either case.
16 lines
502 B
Swift
16 lines
502 B
Swift
// RUN: %target-swift-emit-sil -verify %s
|
|
|
|
struct Block {}
|
|
|
|
class Story {
|
|
final var finalStored = [Block]()
|
|
var overridableStored = [Block]()
|
|
|
|
func test() {
|
|
// expected-error@+2 {{overlapping accesses to 'finalStored', but modification requires exclusive access; consider calling MutableCollection.swapAt(_:_:)}}
|
|
// expected-note@+1 {{conflicting access is here}}
|
|
swap(&self.finalStored[0], &self.finalStored[1])
|
|
swap(&self.overridableStored[0], &self.overridableStored[1])
|
|
}
|
|
}
|