Hi,

This error makes perfect sense, but I’m surprised it's a runtime error. I 
expected it at compile time. Am I doing something wrong? Is this on the type 
system to-do list?

  let c = JSONEncoder()
  struct Foo { … }
  let fs: [Foo] = [ Foo(...) ]
  let data = try! c.encode(fs)   // Didn’t think this would compile

The runtime error is: fatal error: Array<Foo> does not conform to Encodable 
because Foo does not conform to Encodable.

Rob
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to