From d8f63f0699ad705e4d76485bd439d7ce0f8804d2 Mon Sep 17 00:00:00 2001 From: juangamnik Date: Mon, 29 Aug 2016 12:45:22 +0200 Subject: [PATCH] Update XXXX-enhanced-existentials.md If collection is not a reference type changing the first element will have no side effect. --- proposals/XXXX-enhanced-existentials.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/XXXX-enhanced-existentials.md b/proposals/XXXX-enhanced-existentials.md index 377088d9a1..c5237ad42d 100644 --- a/proposals/XXXX-enhanced-existentials.md +++ b/proposals/XXXX-enhanced-existentials.md @@ -658,7 +658,7 @@ Here is an example of how `as?` casting can be used to do 'useful' work at runti ```swift // Set the first element of a string or integer collection to some value. -func setFirstElement(collection: Collection, theInt: Int, theString: String) -> Bool { +func setFirstElement(collection: Collection, theInt: Int, theString: String) where Collection : class -> Bool { guard !collection.isEmpty else { return false } if let intCollection = collection as? Collection where .Element == Int {