mirror of
https://github.com/apple/swift.git
synced 2026-10-02 10:58:03 +02:00
12 lines
371 B
Swift
12 lines
371 B
Swift
// RUN: %target-typecheck-verify-swift -warnings-as-errors
|
|
|
|
@diagnose(PerformanceHints, as: warning)
|
|
func foo() -> [Int] { // expected-warning {{Performance: 'foo()' returns an array, leading to implicit copies. Consider using an 'inout' parameter instead.}}
|
|
return [1,2,3]
|
|
}
|
|
|
|
@diagnose(ReturnTypeImplicitCopy, as: ignored)
|
|
func bar() -> [Int] {
|
|
return [1,2,3]
|
|
}
|