Skip to content

Commit 3769c46

Browse files
committed
unified: Test that writebacks after a mutating call works
1 parent fcf39ec commit 3769c46

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎unified/ql/test/library-tests/dataflow/accessors_local.swift‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,17 @@ func t11() {
9292
}
9393
p.0 = source("t11.1")
9494
}
95+
96+
func t12() {
97+
struct S {
98+
var field: String = "safe"
99+
mutating func mutate() { field = source("t12.1") }
100+
}
101+
var p: S {
102+
get { S() }
103+
set { sink(newValue.field) } // $ MISSING: hasValueFlow=t12.1
104+
}
105+
// TODO: test fails because the call to 'mutate' is not yet resolved
106+
// At the time of writing, the test passes if the call graph is manually patched
107+
p.mutate()
108+
}

0 commit comments

Comments
 (0)