Files
swift-mirror/test/refactoring/rename/prefix_operator.swift
Alex Hoppen 6d2582f5b8 [Refactoring] Fix an issue where refactoring misses to refactor references after prefix operators
The removed `else if` branch caused the argument to the `-` operator to be be reported as `Mismatch`. I couldn’t figure out what that branch was for, so I removed it.

rdar://91588948
2022-05-04 09:04:30 +02:00

14 lines
624 B
Swift

let foo: Int = 12
let negfoo = -foo
print("opposite of \(foo) is \(negfoo)")
// RUN: %empty-directory(%t.result)
// RUN: %refactor -rename -source-filename %s -pos=1:5 -new-name bar >> %t.result/def.swift
// RUN: %target-swift-frontend-typecheck %t.result/def.swift
// RUN: diff -u %S/Outputs/prefix_operator/refactor.swift.expected %t.result/def.swift
// RUN: %refactor -rename -source-filename %s -pos=2:15 -new-name bar >> %t.result/operator_ref.swift
// RUN: %target-swift-frontend-typecheck %t.result/operator_ref.swift
// RUN: diff -u %S/Outputs/prefix_operator/refactor.swift.expected %t.result/operator_ref.swift