mirror of
https://github.com/apple/swift.git
synced 2026-10-12 14:50:47 +02:00
This is not supported for the same reason you can't have a noncopyable variadic parameter, but the code was hard-coded to check for copyability only. Generalize this to apply the generic signature for Array via the common code path, and add a custom note to explain why those requirements are checked in the first place. Cleaning this up also fixed some fuzzer crashes. Reported on the forums: https://forums.swift.org/t/variadic-escapable-arguments-crash-the-compiler/86727/2
11 lines
771 B
Swift
11 lines
771 B
Swift
// {"kind":"typecheck","original":"1098007b","signature":"createPropertyStoreOrCallSuperclassSetter(swift::AccessorDecl*, swift::Expr*, swift::AbstractStorageDecl*, (anonymous namespace)::TargetImpl, llvm::SmallVectorImpl<swift::ASTNode>&, swift::ASTContext&)","signatureAssert":"Assertion failed: (destType->getOptionalObjectType()->isEqual(value->getType())), function createPropertyStoreOrCallSuperclassSetter","signatureNext":"synthesizeTrivialSetterBodyWithStorage"}
|
|
// RUN: not %target-swift-frontend -typecheck %s
|
|
@propertyWrapper struct a<b, c> {
|
|
wrappedValue: [c: b] static subscript<d>(_enclosingInstance e: d, wrapped f: ReferenceWritableKeyPath<d, [c: b]>,
|
|
storage g: ReferenceWritableKeyPath<d, Self>
|
|
) -> b?
|
|
}
|
|
class h {
|
|
@a var i: [String: Int]
|
|
}
|