mirror of
https://github.com/apple/swift.git
synced 2026-10-04 11:58:22 +02:00
Tailor a diagnostic and fix for attributes on aliases, to suggest moving them to the definition and adding preconcurrency if necessary or inlining the alias so attribute can be applied.
8 lines
427 B
Swift
8 lines
427 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
|
|
|
|
import ctypes
|
|
|
|
// Don't crash or try to suggest editing an alias we can't access.
|
|
func takeSendable(_ fn: @Sendable fptr) { } // expected-error{{attribute '@Sendable' cannot be applied to a type alias}}
|
|
// expected-note@-1{{expand 'fptr' (aka '@convention(c) (Int32) -> Int32') to apply '@Sendable'}}{{35-39=@convention(c) (Int32) -> Int32}}
|