Xcode 6.1.1: Templates silently overwrite files

Originator:rix.rob
Number:rdar://19366685 Date Originated:02-Jan-2015 12:09 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.1.1 (6A2008a)
Classification:Serious Bug Reproducible:Always
 
Summary:
Making a new target will silently overwrite any existing files. The old contents aren’t moved to the trash, either, they’re just gone. This is unrecoverable if you haven’t committed/backed up yet.


Steps to Reproduce:
1. Make a new app.
2. Edit some of the sources, e.g. AppDelegate.swift
3. Delete the app target. Note that AppDelegate.swift’s contents are preserved at this point.
4. Make a new target; make it an app target and give it the same name as the previous one had.


Expected Results:
I expected it to preserve my changes, possibly renaming the original file, or prompting me, or moving the original file to the trash.


Actual Results:
It silently overwrote them.


Regression:
N/A


Notes:
This just cost me a morning’s work.

Comments


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!