Why isn’t isUniquelyReferenced(_:) working here?

no, the var expression binds the associated value to a new value s, making it independent from the old value in the enum, which can be destroyed at any time without affecting the newly bound value.