[SR-12350] Projected PropertyWrappers don't trigger didSet when their wrappedValue is mutated #54784
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
property wrappers
Feature: property wrappers
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Version 11.2.1.
Additional Detail from JIRA
md5: d596f1ad1d1b43797a7c9312e67b0d4a
duplicates:
is duplicated by:
Issue Description:
If I call
myInstance.$myWrappedVar.wrappedValue = someValue
, I would expect the didSet observer declared in myInstance to be called.This is a very superficial case, so I've also attached an example of where you'd want to have something like
myInstance.$myWrappedVar.doSomething()
, which mutateswrappedValue
internally cause the didSet Observer to be called.The language reference doesn't explicitly say that the didSet observer isn't called, so I'm calling this a bug and not a feature request, though perhaps it's a bug in the documentation and not the implementation.
The text was updated successfully, but these errors were encountered: