Files
swift-mirror/test/diagnostics/no_warnings_as_errors.swift
Artem Chikin c3b0232c2c Add compiler option to *disable* warnings-as-errors
`-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
2020-04-17 12:10:26 -07:00

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
}