Files
swift-mirror/test/SILOptimizer/polymorphic_inout_aliasing.swift
Slava Pestov 5bcdcd1fa6 FrontendTool: Stop if SILGen emits diagnostics even when lazy type checking is off
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.
2026-01-13 18:24:10 -05:00

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])
}
}