Swift 3.0 migrator adds try twice if methods are chained

Number:rdar://26886954 Date Originated:19-Jun-2016 23:35
Status:Duplicate of 26924050 (open) Resolved:
Product:Developer Tools Product Version:Xcode 8 beta 1
Classification:Other Bug Reproducible:Always
When migrating our codebase from Swift 2.2 -> Swift 3.0 we noticed that when we had multiple chained methods that acquired `throws` in the migration, `try!` was added twice.

Steps to Reproduce:
1. Define an expression where multiple functions are called that now have `throws` in Swift 3.0. Example:

let remoteFileURL = baseAssetsURL
    .URLByAppendingPathComponent(remoteFileName + fileSuffix)

2. Migrate the code

Expected Results:
`try!` is added a single time, resulting in:

let remoteFileURL = try! baseAssetsURL
    .appendingPathComponent(remoteFileName + fileSuffix)

Actual Results:
Instead, two `try!`s are added, resulting in:

let remoteFileURL = try! try! baseAssetsURL
    .appendingPathComponent(remoteFileName + fileSuffix)

Xcode 8 beta 1



Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!