Enums with associated types can't be defaulted to nil when passed as parameter?

(Peter Alfvin) #1

I encountered the following error:

enum Foo { case foo(Bool) }
enum Bar { case bar } 

let x: Foo? = nil

func fooey(f: Foo? = nil) {}  // Error: Type mismatch, expected "Foo?"

func barey(b: Bar? = nil) {}

(RemObjects) #2

Thanks, logged as bugs://77022

(Luke Bartolomeo) #3

+1. This is causing me all kinds of logic problems porting from xCode.

(marc hoffman) #4

i’ll see if we can give this prio fior vNext.

(Carlo Kok) #5

I can’t reproduce this anymore with the release.

(RemObjects) #6

bugs://77022 got closed with status fixed.