I read this comment.
Please tell me about detail of it.
I first thought that it says about conflict of edit between fixits which has overlapped range of text.
But when I use xcode and click fix-it button,
diagnostics are fully regenerated immediately from code which is applied fixit.
So it doesn't seems to happen problems.
Above comment says about extra argument
diagnostic and relabeling argument
diagnostic.
Then I worried about missing argument
and relabeling argument
.
They could be overlapped if input weird source code.
For example:
[omochi@omochi-iMacPro temp]$ cat a.swift
func f(aa: Int, bbbb: Int, cc: Int, dd: Int) {}
f(dd: 1, aa: 1, bbbb: 2)
[omochi@omochi-iMacPro temp]$ swift -frontend -typecheck -fixit-all a.swift -emit-fixits-path a.remap
a.swift:2:2: error: incorrect argument labels in call (have 'dd:aa:bbbb:', expected 'aa:bbbb:cc:dd:')
f(dd: 1, aa: 1, bbbb: 2)
^~~ ~~ ~~~~
aa bbbb cc
a.swift:2:15: error: missing argument for parameter 'cc' in call
f(dd: 1, aa: 1, bbbb: 2)
^
, cc: <#Int#>
a.swift:1:6: note: 'f(aa:bbbb:cc:dd:)' declared here
func f(aa: Int, bbbb: Int, cc: Int, dd: Int) {}
^
I tried to which they can be applied both.
[omochi@omochi-iMacPro temp]$ cat a.remap
[
{
"file": "a.swift",
"offset": 50,
"remove": 2,
"text": "aa",
},
{
"file": "a.swift",
"offset": 57,
"remove": 2,
"text": "bbbb",
},
{
"file": "a.swift",
"offset": 64,
"remove": 4,
"text": "cc",
},
{
"file": "a.swift",
"offset": 62,
"text": ", cc: <#Int#>",
},
]
[omochi@omochi-iMacPro temp]$ c-arcmt-test a.remap
a.swift
/var/folders/1v/_s33fkpj07g9y3zvdfs9cz9m0000gn/T/a.swift-2771df.swift
[omochi@omochi-iMacPro temp]$ cat /var/folders/1v/_s33fkpj07g9y3zvdfs9cz9m0000gn/T/a.swift-2771df.swift
func f(aa: Int, bbbb: Int, cc: Int, dd: Int) {}
f(aa: 1, bbbb: 1, cc: <#Int#>, cc: 2)
Applied result looks ok syntactically.
(Semantically wrong. Because label dd
doesn't exist and cc
are duplicated.)
So I don't understand meaning of one fix would overwrite another.