Swift/Linker error when ClassB uses a variable of type ClassA.SomeEnum when the enum has only 1 case

Originator:dave
Number:rdar://19369147 Date Originated:2015/01/03
Status:Open Resolved:
Product:Xcode Product Version:6.1.1
Classification:Serious Bug Reproducible:Always
 
Summary:
Given 'ClassA' that has an enum 'SomeEnum' with only one possible case, declaring a variable with a type of that enum in some other 'ClassB' causes a linker error: "Undefined symbols for architecture x86_64"

Adding a second case to the enum makes the linker error go away. Changing the var to a let also makes the error go away.

See the attached sample project, including the comments in the 'Achievements.swift' file.

Steps to Reproduce:
Run the attached sample project.

Expected Results:
Build should be successful.


Actual Results:
Build fails with error:
        Undefined symbols for architecture x86_64:
          "__TWvdvC11LinkerError14ViewController4taskOCS_12Achievements4Task", referenced from:
             __TFC11LinkerError14ViewControllerm4taskOCS_12Achievements4Task in ViewController.o
        ld: symbol(s) not found for architecture x86_64
        clang: error: linker command failed with exit code 1 (use -v to see invocation)



Version:
Xcode 6.1.1 (6A2008a) & Version 6.2 Beta 3 (6C101)

Sample Project:
http://cl.ly/2s1O1E1R2z2A

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!