Files
swift-mirror/test/Parse/warning_primary_file.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

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
}