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