Files
swift-mirror/test/attr/diagnose_global_downgrade.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

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