Xcode 7 beta: Compiler can't find Core Graphics and gives bad error

Number:rdar://21788169 Date Originated:12-Jul-2015 08:46 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (7A152u)
Classification:Serious Bug Reproducible:Always
I have a project I’m trying to convert to Swift 2, but it hit a snag on the following error:

> Use of undeclared type ‘CGFloat’; did you mean to use ‘CGFloat’?

In general the compile dies on not knowing Core Graphics exists, with things like “Use of undeclared type ‘CGPoint’”. Explicitly adding CoreGraphics.framework seems to have fixed it, but this isn’t something I’ve needed to do before and if it is a new requirement, it should be picked up by the migrator.

So three issues:

1. You shouldn’t need to manually add CoreGraphics to migrate this project to Swift 2
2. The error is very bad. If it can’t find a type, it shouldn’t recommend you use that type.
3. As an aside, there were dozens of issues in my project the migrator didn’t pick up and I’m needing to fix manually, many having to do with Game Center. If that interests you I can send you the project as it was originally. This one was just particularly weird.

Steps to Reproduce:
1. Open the attached project in Xcode 7b3.
2. Try to build it.

Expected Results:
Compiler recognizes the existence of Core Graphics. (There would still be other errors since I’m still working on the conversion)

Actual Results:
Non-helpful errors about CGFloat, CGPoint, etc not being found like “Use of undeclared type ‘CGFloat’; did you mean to use ‘CGFloat’?”

I hit this converting an existing project to Swift 2.

Attachment: the project in the problem state.


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!