mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
7bbaeebba1
We previously prevented generating safe wrappers on functions with template instantiations in the signature, unless those instantiations were hidden behind a typedef. This is because those template instantiations cannot be expressed in Swift syntax, so the macro would expand to a function with invalid syntax. For the std::span parameter itself however, that type is replaced with a Swift Span in the safe wrapper, so it's not an issue in the type signature. We would previously use the std::span type name from the original signature to cast from Span to std::span, which does not work with the raw std::span type. This uses `.init` instead when this is the case, which avoids spelling out the type. When possible, we still use the concrete type name, for clarity and by providing information we have accessible the typechecker needs to do less work. Resolves #86339 rdar://167712240