mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
`-no-warnings-as-errors` This functionality is required for build systems to be able to overload/disable a given Swift project's preference of treating warnings as errors. Resolves rdar://problem/35699776
13 lines
746 B
Swift
13 lines
746 B
Swift
// RUN: %target-swift-frontend -typecheck -warnings-as-errors -no-warnings-as-errors %s 2>&1 | %FileCheck %s --check-prefix=CHECK-WARNING
|
|
// RUN: not %target-swift-frontend -typecheck -no-warnings-as-errors -warnings-as-errors %s 2>&1 | %FileCheck %s --check-prefix=CHECK-ERROR
|
|
|
|
|
|
// This test verifies that the -no-warnings-as-errors option nullifies the effect of the -warnings-as-errors option
|
|
// CHECK-WARNING-NOT: error: initialization of immutable value 'c' was never used;
|
|
// CHECK-WARNING: warning: initialization of immutable value 'c' was never used;
|
|
// CHECK-ERROR-NOT: warning: initialization of immutable value 'c' was never used;
|
|
// CHECK-ERROR: error: initialization of immutable value 'c' was never used;
|
|
func b() {
|
|
let c = 2
|
|
}
|