Files
swift-mirror/test/attr/attr_alias_imported.swift
Aviva Ruben 21c0dadbf7 [Sema] Tailor diagnostic for attributes on aliases
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.
2026-03-17 11:34:01 -07:00

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