Compiler bug in Xcode 10.2 for Enums with Associated Values

Basically this code produces very odd results in release builds with [-O] Optimization Level. (See attached screenshot).

My bet is that it has something to do with the new "@unknown default" since it works with a custom Enum as Associated Value.

I will file a bug for this! Sorry if this post is unnecessary.

I can reproduce this with -O, but not -Onone.

cc @Erik_Eckstein @Michael_Gottesman

I guess opening a ticket on bugs.swift.org

Having the same issue here, looks like https://bugs.swift.org/browse/SR-5333?jql=text%20~%20"enum%20associated" it was fixed on swift4 and re-appeared on xcode10.2

Terms of Service

Privacy Policy

Cookie Policy