mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A parse-only option is needed for parse performance tracking and the current option also includes semantic analysis.
21 lines
659 B
Swift
21 lines
659 B
Swift
// RUN: %target-swift-frontend -typecheck -verify -primary-file %s %S/Inputs/warning_nonprimary_file.swift
|
|
|
|
// Tests that parse warnings are only emitted for the primary
|
|
// input. Below, we expect a warning diagnostic to be emitted
|
|
// because this is the primary file.
|
|
//
|
|
// However, we also pull in ./warning_nonprimary_file.swift,
|
|
// which would emit a warning for an unknown operating system
|
|
// configuration argument, but doesn't because it's not the
|
|
// primary input.
|
|
|
|
public func foo(x: Int, y: Int) -> Int {
|
|
return x + y
|
|
}
|
|
|
|
public func baz(x: Int, y: Int) -> Int {
|
|
var z = x // expected-warning {{variable 'z' was never mutated}}
|
|
return z + y
|
|
}
|
|
|