Files
swift-mirror/test/attr/diagnose_group_inheritance.swift
Artem Chikin 740800dd21 [SourceWarningControl] Promote '@diagnose' attribute to a default language feature
No longer experimental as of approval of SE-0522.

Resolves rdar://176535491
2026-05-08 09:59:11 +01:00

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]
}